Syn
Cache Replace
<void> syn.cache_replace(<Instance> obj, <Instance> t_obj)
Replace obj
in the instance cache with t_obj
.
Cache Invalidate
<void> syn.cache_invalidate(<Instance> obj)
Invalidate obj
's cache entry, forcing a recache upon the next lookup.
Set Thread Identity
<void> syn.set_thread_identity(<number> n)
Sets the current thread identity after a Task Scheduler cycle is performed. (Note: call wait() after invoking this function for the expected results)
Get Thread Identity
<number> syn.get_thread_identity(<void>)
Returns the current thread identity.
Is Cached
<bool> syn.is_cached(<Instance> obj)
Returns true if obj
is currently cached within the registry.
Write Clipboard
<void> syn.write_clipboard(<string> content)
Writes content
to the current Windows clipboard.
Queue On Teleport
<void> syn.queue_on_teleport(<string> code)
Executes code
after player is teleported.
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)
Protect Gui
<void> syn.protect_gui(<obj> gui)
Protects your gui
from recursive FindFirstChild-style attacks. After you call the function, recursive FFA calls from non-Synapse contexts will skip over your protected instances & all children of such instances.
Example
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")
Unprotect Gui
<void> syn.unprotect_gui(<obj> gui)
Removes protection from the gui
. Errors if gui
isn't already protected.
Is Beta
<bool> syn.is_beta(<void>)
Returns a bool indicating whether the user is using Synapse Beta or not.
Crypto
<...> syn.crypto.*
Alias for syn.crypt.*
. You can view the functions in the crypt section.
Request
<table> syn.request(<table> options)
Sends a http request with parameters in options
.
Request Dictionary Fields
Name | Type | Required | Description |
---|---|---|---|
Url | String | Yes | The target URL for this request. Must use http or https protocols. |
Method | String | No | The HTTP method being used by this request, most often GET or POST. |
Headers | Dictionary | No | A dictionary of headers to be used with this request. Most HTTP headers are accepted here, but not all. |
Body | String | No | The request body. Can be any string, including binary data. Must be excluded when using the GET or HEAD HTTP methods. It might be necessary to specify the Content-Type header when sending JSON or other formats. |
Response Dictionary Fields
Name | Type | Description |
---|---|---|
Success | Boolean | The success status of the request. This is true if and only if the StatusCode lies within the range [200, 299]. |
StatusCode | Integer | The HTTP response code identifying the status of the response. |
StatusMessage | String | The status message that was sent back. |
Headers | Dictionary | A dictionary of headers that were set in this response. |
Body | String | he request body (content) received in the response. |
Synapse Headers
Name | Description |
---|---|
Syn-Fingerprint | Users HWID, changes between PCs. |
Syn-User-Identifier | Similar to Syn-Fingerprint , but does not change between PCs. Pretty useful as a way to identify Synapse accounts for cross-PC save data/etc. |
User-Agent | The version of synapse the request was made from. Example: synx/v2.1.3b . |
Example
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
Secure Call
<idk> syn.secure_call(<function> func, <script> script, <...> args)
Spoofs caller environment and context when calling func
with script
's environment. You can pass as many arguments args
as is required. Secure_call returns whatever the called function returns.
Example
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
Create Secure Function
<string> syn.create_secure_function(<string> code)
Protects your code
with secure function, making it impossible for others to alter or view your code. This function can only be used by users who have been given access.
Run Secure Function
<void> syn.run_secure_function(<string> code)
Runs code
protected by secure function.
Secrun
<???> syn.secrun(<string>)
Internal function used for whitelist security and bypassing luau when it was new. Back then Synapse had an exploit to disable luau.