### Getting ReplicatedStorage Service in Roblox Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/metamethod_hook_examples.md Obtains a reference to the `ReplicatedStorage` service. This service is often used for storing assets accessible by both client and server. ```Lua local ReplicatedStorage = game:GetService("ReplicatedStorage") ``` -------------------------------- ### Getting LocalPlayer Service in Roblox Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/metamethod_hook_examples.md Obtains a reference to the `LocalPlayer` object from the `Players` service. This is a common prerequisite for operations involving the client's player. ```Lua local LocalPlayer = game:GetService("Players").LocalPlayer ``` -------------------------------- ### Example Decompiled Roblox UI Creation (Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/decompiler.md This code snippet shows an example of Lua code decompiled by Synapse X. It demonstrates the creation of various Roblox UI instances like ScreenGui, Frame, TextLabel, TextBox, TextButton, and ImageLabel using `Instance.new()`. This illustrates the typical structure and variable naming found in decompiled scripts. ```Lua -- Decompiled with the Synapse X Luau decompiler. function CreateGui() local v1 = Instance.new("ScreenGui"); local v2 = Instance.new("Frame"); local v3 = Instance.new("Frame"); local v4 = Instance.new("TextLabel"); local v5 = Instance.new("TextBox"); local v6 = Instance.new("Frame"); local v7 = Instance.new("Frame"); local v8 = Instance.new("TextButton"); local v9 = Instance.new("TextLabel"); local v10 = Instance.new("TextLabel"); local v11 = Instance.new("ImageLabel"); local v12 = Instance.new("Frame"); local v13 = Instance.new("Frame"); end ``` -------------------------------- ### Example Custom Encrypt/Decrypt - Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/crypt_lib.md This Lua example demonstrates how to use the custom encryption and decryption functions with the 'aes-gcm' cipher. It shows the process of encrypting a string, printing the result, and then decrypting it back to the original string. ```lua local enc = syn.crypt.custom.encrypt( "aes-gcm", "hi gamers!", "$nLliCMdi7gcynsFCK9u0aVNdtkNIiZG", "Agd13KuKIL2$") -- in production, generate a nonce via syn.crypt.random print(enc) print(syn.crypt.custom.decrypt( "aes-gcm", enc, "$nLliCMdi7gcynsFCK9u0aVNdtkNIiZG", "Agd13KuKIL2$")) --"hi gamers" ``` -------------------------------- ### Making a GET Request with syn.request in Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/web_api.md This snippet demonstrates how to use the `syn.request` function in Synapse X to perform a basic GET request to a specified URL. It shows how to pass a configuration table with the `Url` and `Method` properties and then access the `Body` property of the returned response table to print the content. ```lua local Response = syn.request({ Url = "https://example.com", Method = "GET" }) print(Response.Body) ``` -------------------------------- ### Example Usage: rconsoleprint with Color (Synapse Script) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/console.md Demonstrates how to use the `rconsoleprint` function, including how to apply colors using special color codes like `@@RED@@` before the text you want colored. ```syn rconsoleprint('@@RED@@') rconsoleprint('this is red') ``` -------------------------------- ### Getting Synapse Asset (Synapse X) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/misc.md Returns a string formatted as a fake Asset ID (`Content`) for a given `path` to a local file. This allows GUI elements to load local files as if they were Roblox assets, but the effect is client-side only. Note: Certain instances only work with specific file types. For example, `VideoFrame`'s only work with `.webm` encoded videos. ```syn getsynasset( path) ``` -------------------------------- ### Example Usage - Creating and Removing Line - Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/drawing_lib.md Demonstrates creating a 'Line' drawing object, setting its properties like visibility, points, color, thickness, transparency, and ZIndex, waiting for 5 seconds, and then manually removing the object. ```lua local Line = Drawing.new("Line") Line.Visible = true Line.From = Vector2.new(0, 0) Line.To = Vector2.new(200, 200) Line.Color = Color3.fromRGB(255, 255, 255) Line.Thickness = 2 Line.Transparency = 1 LIne.ZIndex = 1 wait(5) Line:Remove() --Drawing objects are manually managed. ``` -------------------------------- ### Example Usage of Synapse X WebSocket Library (Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/websocket_lib.md Demonstrates connecting to a WebSocket server, handling incoming messages using the OnMessage event, sending periodic messages using the Send method, and closing the connection using the Close method. ```lua local WebSocket = syn.websocket.connect("ws://localhost:123/test") -- Specify your WebSocket URL here. WebSocket.OnMessage:Connect(function(Msg) print(Msg) -- Print messages sent to SX. end) local Ctr = 1 while wait(1) do WebSocket:Send("gamer vision " .. tostring(Ctr)) -- Send messages to the WebSocket server. WebSocket:Send("epic gamer vision " .. tostring(Ctr)) WebSocket:Send("epicer gamer vision " .. tostring(Ctr)) Ctr = Ctr + 1 if Ctr == 150 then WebSocket:Close() -- Close the websocket when you are done! (this is done implicitly on teleports aswell) do return end end end ``` -------------------------------- ### Get Info (Synapse X Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/debug_lib.md Returns a table of info pertaining to the lua function `fi`. ```Synapse X Lua debug.getinfo(union fi, w = "flnSu") ``` -------------------------------- ### Getting All Instances (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Returns a table containing all instances currently present within the game's data model. This provides a comprehensive list of all objects in the game hierarchy. ```Synapse > getinstances() ``` -------------------------------- ### Get Registry (Synapse X Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/debug_lib.md Returns the Lua registry. ```Synapse X Lua
debug.getregistry() ``` -------------------------------- ### Get Protos (Synapse X Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/debug_lib.md Returns a table containing the inner functions of function `f`. Note these functions will not have upvalues, use `debug.getproto` with activated `true` to get a list of instances. ```Synapse X Lua
debug.getprotos( f) ``` -------------------------------- ### Get Proto (Synapse X Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/debug_lib.md Gets the inner function of `f` at `index`. Note if `activated` is true, instead it will return a table of functions. These are the instances of that function that exist within the GC. ```Synapse X Lua union> debug.getproto( f, index, activated) ``` -------------------------------- ### Capturing Variable Arguments in Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/metamethod_hook_examples.md Demonstrates how to collect all variable arguments passed to a function (`...`) into a table named `Args`. This is useful when dealing with functions that accept a variable number of parameters. ```Lua local Args = {...} ``` -------------------------------- ### Get Stack (Synapse X Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/debug_lib.md Gets the method stack at level `indice`. ```Synapse X Lua
debug.getstack( indice) ``` -------------------------------- ### Getting Loaded ModuleScripts (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Returns a table containing all ModuleScript instances that have been loaded (required) by scripts in the game. This provides access to the instances of required modules. ```Synapse > getloadedmodules() ``` -------------------------------- ### Using syn.secure_call with Custom Environment (Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/syn_lib.md An example demonstrating the use of `syn.secure_call` to call a function (`KeyHandler`) and a method (`Result.getKey`) while spoofing the environment using a custom table (`FakeEnv`). Note that this function is deprecated. ```lua local KeyHandler = require(game:GetService("ReplicatedStorage").Assets.Modules.KeyHandler) local PlayerName = game:GetService("Players").LocalPlayer.Name local FakeEnv = game:GetService("Workspace").Live[PlayerName].CharacterHandler.Input local Result = syn.secure_call(KeyHandler, FakeEnv) local Event = syn.secure_call(Result.getKey, FakeEnv, "ApplyFallDamage", "plum") --Do whatever ``` -------------------------------- ### Getting All Scripts (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Returns a table containing all LocalScript and ModuleScript instances currently present in the game. This allows inspection or manipulation of existing scripts. ```Synapse >> getscripts() ``` -------------------------------- ### Testing __index Hook on LocalPlayer.Character in Roblox Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/metamethod_hook_examples.md Demonstrates the effect of the `__index` hook by attempting to print the `Character` property of the `LocalPlayer`. If the hook is active and the call is from a game thread, it should print `nil`. ```Lua print(game:GetService("Players").LocalPlayer.Character) ``` -------------------------------- ### Testing __namecall Hook on GetService("Workspace") in Roblox Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/metamethod_hook_examples.md Demonstrates the effect of the `__namecall` hook by attempting to print the result of `game:GetService("Workspace")`. If the hook is active and the call is from a game thread, it should print the `ReplicatedStorage` service instead of `Workspace`. ```Lua print(game:GetService("Workspace")) ``` -------------------------------- ### Getting Connections to a Signal (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Returns a list of Connection objects currently connected to the specified ScriptSignal object. Each Connection object provides properties and methods to interact with the connection. ```Synapse > getconnections( obj) ``` -------------------------------- ### Modifying an Upvalue using debug.setupvalue in Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/debug_api.md This example shows how to use the `debug.setupvalue` function to change the value of an upvalue (`TestVariable`) associated with a function (`Test`) before it is executed. ```Lua local TestVariable = "Hello, world!" local function Test() print(TestVariable) TestVariable = "Still - Hello, world!" print(TestVariable) end debug.setupvalue(Test, 1, "Hello, modified world!") Test() ``` -------------------------------- ### Get Upvalues (Synapse X Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/debug_lib.md Retrieve the upvalues in function `fi` or at level `fi`. ```Synapse X Lua
debug.getupvalues(union fi) ``` -------------------------------- ### Get Constants (Synapse X Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/debug_lib.md Retrieve the constants in function `fi` or at level `fi`. ```Synapse X Lua
debug.getconstants(union fi) ``` -------------------------------- ### Line Drawing Properties - Synapse X Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/drawing_lib.md Properties specific to the Line drawing object type. Defines the thickness of the line and its start and end points using Vector2. ```syn number Thickness; Vector2 From; Vector2 To; ``` -------------------------------- ### Getting Special Instance Info (Synapse X) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/misc.md Retrieves a table containing special, often internal, properties for specific instance types like `MeshParts`, `UnionOperations`, and `Terrain`. The returned table structure varies depending on the type of the input `obj`. ```syn
getspecialinfo( obj) ``` -------------------------------- ### Getting Nil-Parented Instances (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Returns a table containing all instances whose parent property is currently set to `nil`. These instances are not part of the main game hierarchy but may still exist in memory. ```Synapse > getnilinstances() ``` -------------------------------- ### Hooking __index Metamethod in Roblox Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/metamethod_hook_examples.md Hooks the `__index` metamethod on the `game` object. It intercepts attempts to access `LocalPlayer.Character` from non-Synapse X threads (`checkcaller()`) and returns `nil` instead of the actual character. Requires a reference to the `LocalPlayer` and the original `__index` function. ```Lua local LocalPlayer = game:GetService("Players").LocalPlayer local OldIndex = nil OldIndex = hookmetamethod(game, "__index", function(Self, Key) if not checkcaller() and Self == LocalPlayer and Key == "Character" then return nil end return OldIndex(Self, Key) end) ``` -------------------------------- ### Get Upvalue (Synapse X Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/debug_lib.md Returns the upvalue with name `idx` in function or level `fi`. ```Synapse X Lua debug.getupvalue(union fi, idx) ``` -------------------------------- ### Get Constant (Synapse X Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/debug_lib.md Returns the constant at index `idx` in function `fi` or level `fi`. ```Synapse X Lua debug.getconstant(union fi, idx) ``` -------------------------------- ### Hooking __namecall Metamethod in Roblox Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/metamethod_hook_examples.md Hooks the `__namecall` metamethod on the `game` object. It intercepts calls to `game:GetService("Workspace")` from non-Synapse X threads (`checkcaller()`) and returns the `ReplicatedStorage` service instead of `Workspace`. Requires references to `ReplicatedStorage` and the original `__namecall` function. ```Lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local OldNameCall = nil OldNameCall = hookmetamethod(game, "__namecall", function(Self, ...) local Args = {...} local NamecallMethod = getnamecallmethod() if not checkcaller() and Self == game and NamecallMethod == "GetService" and Args[1] == "Workspace" then return ReplicatedStorage end return OldNameCall(Self, ...) end) ``` -------------------------------- ### Get Raw Metatable (Synapse X) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/table.md Retrieves the metatable of a given value, ignoring the `__metatable` field if it exists. Returns `nil` if the metatable does not exist. ```syn
getrawmetatable(
value) ``` -------------------------------- ### Disabling Signal Connections (Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md This Lua example demonstrates how to use `getconnections` to retrieve all connections attached to a specific signal (in this case, `workspace.ChildAdded`) and then iterate through them to disable each connection. ```Lua for i, connection in pairs(getconnections(workspace.ChildAdded)) do connection:Disable() end ``` -------------------------------- ### Getting a Hidden Property (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Retrieves the value of a property on an Instance that is not normally accessible or visible. Errors if the specified property does not exist on the object. ```Synapse gethiddenproperty( Object, Property) ``` -------------------------------- ### Get Current Thread Identity (Syn) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/syn_lib.md Returns the current identity level of the thread as an unsigned integer. This value indicates the permission level under which the current code is executing. ```syn syn.get_thread_identity() ``` -------------------------------- ### Getting Local Environment (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Returns the global environment table specific to the LocalScript state. This is useful for interacting with variables and functions accessible within the context of a client-side script. ```Synapse
getrenv() ``` -------------------------------- ### Getting Garbage Collection Data (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Returns a list of values currently tracked by the Lua garbage collector. By default, it includes functions and userdata. Passing `true` as an argument will also include tables in the returned list. ```Synapse
getgc( include_tables) ``` -------------------------------- ### Getting Global Environment (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Returns the environment table that is applied to every script executed by Synapse X. This environment typically contains custom functions and variables provided by the exploit. ```Synapse
getgenv() ``` -------------------------------- ### Getting Script Environment in Synapse X Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/script.md Retrieves the environment table associated with a given LocalScript or ModuleScript. This function will produce an error if the specified script is not currently loaded into memory. ```syn
getsenv(union Script) ``` -------------------------------- ### Getting Calling Script in Synapse X Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/script.md Returns the script (LocalScript or ModuleScript) that is currently executing and calling this function. Returns nil if called from a context not associated with a specific script. ```syn > getcallingscript() ``` -------------------------------- ### Logging FireServer Function Hook - Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/function_hooks.md An expanded example of hooking 'FireServer' that adds logging functionality. It checks if the caller is not the script itself using 'checkcaller()' and, if not, prints the RemoteEvent instance and all arguments passed to 'FireServer' before calling the original function. ```Lua local OldFireServer OldFireServer = hookfunction(Instance.new'RemoteEvent'.FireServer, newcclosure(function(Event, ...) if not checkcaller() then local Args = {...} print(Event) for I, V in pairs(Args) do print(V) end end return OldFireServer(Event, ...) end)) ``` -------------------------------- ### Accessing Original Globals via getrenv (Synapse X) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/script_env.md Shows how to retrieve the original `shared` or `_G` table that existed before Synapse X attached and created its own versions, using the `getrenv` function. ```Lua getrenv().shared ``` -------------------------------- ### Getting Namecall Method (Synapse X) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/misc.md Retrieves the string name of the method currently being called if the function is invoked within a `__namecall` metatable hook. This is useful for inspecting or modifying the behavior of method calls. ```syn getnamecallmethod() ``` -------------------------------- ### Getting Lua Registry (Synapse) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/environment.md Returns the Lua registry table. The registry is a special table accessible from C code, often used to store references to Lua values that need to persist across C function calls or garbage collection cycles. ```Synapse
getreg() ``` -------------------------------- ### Getting Script Hash in Synapse X Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/script.md Calculates and returns a SHA384 hash of the bytecode for the provided script. This hash can be utilized to detect if the script's content has been modified since it was last checked. ```syn getscripthash(union Script) ``` -------------------------------- ### Modifying Function Constant using debug.setconstant in Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/debug_api.md This example shows how to use `debug.setconstant` to change a constant value within a function's bytecode. In this case, it modifies the string literal 'Still - Hello, world!'. ```Lua local TestVariable = "Hello, world!" local function Test() print(TestVariable) TestVariable = "Still - Hello, world!" print(TestVariable) end debug.setconstant(Test, 2, "Modified - Hello, world!") Test() ``` -------------------------------- ### Creating New Folder (syn) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/filesystem.md Creates a new folder (directory) at the specified path. If the folder already exists, this function typically does nothing or succeeds without error. ```syn makefolder( path) ``` -------------------------------- ### Getting Script Closure in Synapse X Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/script.md Obtains a basic function object derived from the specified script. It's important to note that this function is a 'bare' version and will not retain the original script's upvalues or environment context correctly. ```syn getscriptclosure(union Script) ``` -------------------------------- ### Making HTTP Requests with syn.request (Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/syn_lib.md Demonstrates how to use `syn.request` to send an HTTP POST request with a JSON body. It includes setting the URL, method, headers, and body. The response is then iterated and printed. ```lua local response = syn.request( { Url = "http://httpbin.org/post", -- This website helps debug HTTP requests Method = "POST", Headers = { ["Content-Type"] = "application/json" -- When sending JSON, set this! }, Body = game:GetService("HttpService"):JSONEncode({hello = "world"}) } ) for i,v in pairs(response) do print(i,v) if type(v) == "table" then for i2,v2 in pairs(v) do warn(i2,v2) end end end ``` -------------------------------- ### Creating Files with writefile - Synapse X Lua Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/filesystem_api.md Creates a new file or overwrites an existing one in the Synapse X workspace directory. It takes the filename and the content to write as arguments. ```lua writefile("test.txt", "Testing!") ``` -------------------------------- ### Printing Script Identity (Normal Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/script_env.md Demonstrates how to check the execution identity of a standard Roblox LocalScript, which typically runs at identity 2. ```Lua printidentity() ``` -------------------------------- ### Attempting to Modify Script Global (Synapse X) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/development/script_env.md Illustrates an attempt to modify a property of the `script` global in a Synapse X environment, highlighting that such operations are often ineffective or fake. ```Lua script.Disabled = true ``` -------------------------------- ### Queue Code Execution After Teleport (Syn/Lua) Source: https://github.com/orangedoggo/synapse-x-docs/blob/main/src/reference/syn_lib.md Queues a string of `code` to be executed by Synapse after the player successfully teleports to a new place. This is commonly used to run initialization code in the new game instance. ```syn syn.queue_on_teleport( code) ``` ```lua game:GetService("Players").LocalPlayer.OnTeleport:Connect(function(State) if State == Enum.TeleportState.Started then syn.queue_on_teleport("