Skip to content
Burkino edited this page Jun 23, 2020 · 11 revisions

Better Synapse Docs: https://synapsexdocs.github.io

Intro

  • Most of this is found within other popular software of the same kind as ours. Most of the functions existed in the previous iteration of Synapse.
  • Some functions may be defined under several names (for example, checkcaller is also defined as is_protosmasher_caller) for compatibility with scripts written for other software. Those other definitions are not included in this document for the sake of organization.

Environment Helper Functions

<table> getgenv(<void>)  

Returns the environment that will be applied to each script ran by Synapse.

<table> getrenv(<void>)  

Returns the global Roblox environment for the LocalScript state.

<table> getreg(<void>)  

Returns the Lua registry.

<table> getgc(<void>)  

Returns a copy of the Lua GC list.

<table> getinstances(<void>)  

Returns a list of all instances within the game.

<table> getnilinstances(<void>)  

Returns a list of all instances parented to nil within the game.

<table> getscripts(<void>)  

Returns a list of all scripts within the game.

<table> getloadedmodules(<void>)  

Returns all ModuleScripts loaded in the game.

<table> getconnections(<Signal> obj)  

Gets a list of connections to the specified signal. You can then use :Disable and :Enable on the connections to disable/enable them.

Keyboard/Mouse Functions

<bool> isrbxactive(<void>)  

Returns if the Roblox window is in focus. This must return true for any other mouse/keyboard function to work.


<void> keypress(<int> keycode)  

Simulates a key press for the specified keycode. For more information: https://docs.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes

<void> keyrelease(<int> key)  

Releases key on the keyboard. You can access the int key values on MSDN.


<void> mouse1click(<void>)  

Simulates a full left mouse button press.

<void> mouse1press(<void>)  

Simulates a left mouse button press without releasing it.

<void> mouse1release(<void>)  

Simulates a left mouse button release.


<void> mouse2click(<void>)  

Simulates a full right mouse button press.

<void> mouse2press(<void>)  

Clicks down on the right mouse button.

<void> mouse2release(<void>)  

Simulates a right mouse button release.


<void> mousescroll(<signed int> px)  

Scrolls the mouse wheel virtually by px pixels.

<void> mousemoverel(<int> x, <int> y)  

Moves the mouse cursor relatively to the current mouse position by coordinates x and y.

Hooking Functions

<function> hookfunction(<function> old, <function> hook)  

Hooks function 'old', replacing it with the function 'hook'. The old function is returned, you must use it to call the function further.

<function> newcclosure(<function> f)  

Pushes a new CClosure that invokes function f upon call. Used for metatable hooks.

File Functions

<string> readfile(<string> path)  

Reads the contents of the file located at path and returns it. If the file does not exist, it errors.

<void> writefile(<string> filepath, <string> contents)  

Writes contents to the supplied filepath.

<void> appendfile(<string> path, <string> content)  

Appends content to the file contents at path. If the file does not exist, it errors.

<function> loadfile(<string> path)  

Loads in the contents of a file as a chunk and returns it if compilation is successful. Otherwise, if an error has occured during compilation, nil followed by the error message will be returned.

Script Environment Functions

<table> getsenv(<LocalScript, ModuleScript> Script)  

Returns the environment of Script. Returns nil if the script is not running.

<LocalScript, ModuleScript, nil> getcallingscript(<void>)  

Gets the script that is calling this function.

Table Modification Functions

<table, nil> getrawmetatable(<T> value)  

Retrieve the metatable of value irregardless of value's metatable's __metatable field. Returns nil if it doesn't exist.

<void> setreadonly(<table> table, <bool> ro)  

Sets table's read-only value to ro

<bool> isreadonly(<table> table)  

Returns table's read-only condition.

Reflection Functions

<function> loadstring(<string> chunk, [<string> chunkname])  

Loads chunk as a Lua function and returns it if compilation is succesful. Otherwise, if an error has occured during compilation, nil followed by the error message will be returned.

<bool> checkcaller(<void>)  

Returns true if the current thread was made by Synapse. Useful for metatable hooks.

<bool> islclosure(<function> f)  

Returns true if f is an LClosure

<string> dumpstring(<string> Script)  

Returns the Roblox formatted bytecode for source string Script.

<string> decompile(<LocalScript, ModuleScript, function> Script, bool Bytecode = false)  

Decompiles Script and returns the decompiled script. If the decompilation fails, then the return value will be an error message.

Misc Functions

<void> setclipboard(<string> value)  

Sets value to the clipboard.

<void> setnonreplicatedproperty(<Instance> obj, <string> prop, <T> value)  

Sets the prop property of obj, not replicating to the server. Useful for anticheat bypasses.

<table> getspecialinfo(<Instance> obj)  

Gets a list of special properties for MeshParts, UnionOperations, and Terrain instances.

<void> saveinstance(<table> t = { noscripts = false, mode = "optimized" })  

Saves the Roblox game into your workspace folder. You can use table t to customize options for this.

debug Library

<table> debug.getlocals(<int> lvl)  

Returns a table containing the upvalues at level lvl.

<T> debug.getlocal(<int> lvl, <string> localname)  

Returns the local with name localname in level lvl.

<void> debug.setlocal(<int> lvl, <string> localname, <T> value)  

Set local localname to value value at level lvl.


<table> debug.getconstants(<function, int> fi)  

Retrieve the constants in function fi or at level fi.

<T> debug.getconstant(<function, int> fi, <int> idx)  

Returns the constant at index idx in function fi or level fi.

<void> debug.setconstant(<function, int> fi, <string> consname, <int, bool, nil, string> value)  

Set constant consname to tuple value at level or function fi.


<table> debug.getupvalues(<function, int> fi)  

Retrieve the upvalues in function fi or at level fi.

<T> debug.getupvalue(<function, int> fi, <string> upval)  

Returns the upvalue with name upval in function or level fi.

<void> debug.setupvalue(<function, int> fi, <string> upvname, <T> value)  

Set upvalue upvname to value value at level or function fi.


<table> debug.setmetatable(<T> o, <table> mt)  

Set the metatable of o to mt.

<table> debug.getregistry(<void>)  

Returns the Lua registry.

debug.getinfo(<function, int> fi, <string> w = "flnSu")  

Returns a table of info pertaining to the Lua function fi.

bit Library

<int> bit.bdiv(<uint> dividend, <uint> divisor)  

Divides dividend by divisor, remainder is not returned.

<int> bit.badd(<uint> a, <uint> b)  

Adds a with b, allows overflows (unlike normal Lua).

<int> bit.bsub(<uint> a, <uint> b)  

Subtracts a with b, allows overflows (unlike normal Lua).

<int> bit.rshift(<uint> val, <uint> by)  

Does a right shift on val using by.

<int> bit.band(<uint> val, <uint> by)  

Does a logical AND (&) on val using by.

<int> bit.bor(<uint> val, <uint> by)  

Does a logical OR (|) on val using by.

<int> bit.bxor(<uint> val, <uint> by)  

Does a logical XOR (⊕) on val using by.

<int> bit.bnot(<uint> val)  

Does a logical NOT on val.

<int> bit.bmul(<uint> val, <uint> by)  

Multiplies val using by, allows overflows (unlike normal Lua)

<int> bit.bswap(<uint> val)  

Does a bitwise swap on val.

<int> bit.tobit(<uint> val)  

Converts val into proper form for bitwise operations.

<int> bit.ror(<uint> val, <uint> by)  

Rotates right val using by.

<int> bit.lshift(<uint> val, <uint> by)  

Does a left shift on val using by.

<string> bit.tohex(<uint> val)  

Converts val to a hex string.

syn Library

<string> syn.crypt.encrypt(<string> data, <string> key)  

Encrypt's data with key.

<string> syn.crypt.decrypt(<string> data, <string> key)  

Decrypt's data with key.

<string> syn.crypt.base64.encode(<string> data)  

Encodes data with bas64.

<string> syn.crypt.base64.decode(<string> data)  

Decodes data with bas64.

<string> syn.crypt.hash(<string> data)  

Hashes data.

<void> syn.cache_replace(<Instance> obj, <Instance> t_obj)  

Replace obj in the instance cache with t_obj.

<void> syn.cache_invalidate(<Instance> obj)  

Invalidate obj's cache entry, forcing a recache upon the next lookup.

<void> syn.set_thread_identity(<int> n)  

Sets the current thread identity after a Task Scheduler cycle is performed. (Note: call wait() after invoking this function for the expected results)

<int> syn.get_thread_identity(<void>)  

Returns the current thread identity.

<bool> syn.is_cached(<Instance> obj)  

Returns true if obj is currently cached within the registry.

<void> syn.write_clipboard(<string> content)  

Writes content to the current Windows clipboard.

<WebSocket> syn.open_web_socket(<string> name)  

Open's the Synapse WebSocket with channel name. This function will not exist if the user did not enable WebSocket support in theme.json.

Notes

  • _G and shared are replaced by Synapse with its own copy for security reasons. Use getrenv()._G/getrenv().shared if you want to access the original.
  • Always use newcclosure for metatable hooks - this is required to prevent detection methods and internal checks.

blah blah blah, adding new stuff from examples posted in the discord

syn.queue_on_teleport("print'this will be printed after you TP'")

Example:

game:GetService("Players").LocalPlayer.OnTeleport:Connect(function(State)
    if State == Enum.TeleportState.Started then
        syn.queue_on_teleport("<script to execute after TP>")
    end
end)

Syn.Request https://developer.roblox.com/en-us/api-reference/function/HttpService/RequestAsync

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

syn.protect_gui & syn.unprotect_gui

local GUI = game:GetObjects("whatever")[1]
syn.protect_gui(GUI) -- Its preferable to call protect_gui before your GUI is parented, but it is not required.
GUI.Parent = game:GetService("CoreGui")

syn.secure_call

Pushed a new function - reinject S^X twice to get it.
syn.secure_call - I saw skids start to add getfenv/context checks to their modules, this will counter that. Simply pass the function itself, an environment to spoof as, and arguments after. See example below on Rogue Lineage.
--You can now pass a table instead of a script if you want to set certian features of the secure_call.

local UIManager = game:GetService("ReplicatedFirst").UIManager
local GetKey = rawget(getsenv(UIManager), "gk")
local Result = syn.secure_call(GetKey, {
  Script = UIManager, --Required, self-explanatory.
  Environment = getsenv(UIManager), --Optional, defaults to getsenv(Script). You can pass a custom env to spoof as here.
  LineNumber = 150 --Optional, defaults to a random line within the script bounds.
}, "ApplyFallDamage")
print(Result)

firetouchinterest

firetouchinterest(<part you touch with> game.Players.LocalPlayer.Character.HumanoidRootPart, <part you want to touch> workspace.Part, <0 = true, 1 = false>)

isnetworkowner

<bool> isnetworkowner(<BasePart> Instance)

setsimulationradius

<void> setsimulationradius(<float> radius, <float?> max_radius)