Definitions with a violet background are proprietary extensions, which are exclusive to Synapse X. Otherwise, definitions without a colored background are from the DCL standard.

Clipboard Library

string syn_clipboard_get(void)

Return the clipboard's content

No example provided

void syn_clipboard_set(string Content)

Set the system's clipboard to Content

No example provided

Reflection and Engine Library

object<WebSocket> syn_net_websocket(string Name)

Opens the Synapse Websocket with channel Name. This function will be absent if WebSocket support is disabled in theme.json

No example provided

string syn_dumpstring(string Script)

Dumps the bytecode for the Script chunk.

No example provided

void syn_obj_save(table Flags)

Saves the current game to your workspace folder. Flags is a table containing two fields: noscripts, a boolean specifying whether scripts are to be decompiled automatically, and mode, which is a string that sets the serialization mode.

No example provided

void syn_obj_override(object Object, string PropertyName, any Value)

Overrides field PropertyName in Object to Value and prevents its replication.

No example provided

table syn_obj_specialinfo(object Object)

Returns a list of special properties for certain instances, such as MeshParts, UnionOperations or Terrain.

No example provided

string syn_decompile(ModuleScript> Script, bool Bytecode)

Decompiles Script and returns the decompiled script, or its bytecode if Bytecode is true.

No example provided

bool syn_islclosure(function Fn)

Returns true if Fn is a Lua function.

No example provided

bool syn_checkcaller(void)

Returns true if the current thread is owned by Synapse X.

No example provided

Console Library

void syn_console_iprint(string Arg)

Akin to syn_console_print but prefixes Arg with [INFO]. Mainly used by internal scripts for debugging purposes.

No example provided

void syn_console_print(string Arg)

Prints Arg to the allocated console.

No example provided

void syn_console_name(string Name)

Set the currently allocated console's title to Name.

No example provided

string syn_console_input(void)

Yields the Engine and returns the user's input.

No example provided

void syn_console_eprint(string Arg)

Akin to syn_console_print but prefixes Arg with [ERR]. Mainly used by internal scripts for debugging purposes.

No example provided

void syn_console_wprint(string Arg)

Akin to syn_console_print but prefixes Arg with [WARN]. Mainly used by internal scripts for debugging purposes.

No example provided

string syn_console_input_async(void)

Yields the current thread and returns the user's input.

No example provided

Table Extensions

variant<table/nil> getrawmetatable(variant<table/userdata> Value)

Retrieves the metatable of value if it exists, or return nil.

No example provided

void table.lock(table T)

Locks T, preventing modifications.

No example provided

bool table.islock(table T)

Returns true or false depending if T is locked or not.

No example provided

void table.unlock(table T)

Unlocks T, allowing modifications.

No example provided

IO Library

bool syn_io_isfile(string Filepath)

Returns whether the file at Filepath is a file.

No example provided

string syn_io_read(string Filepath)

Reads the contents at filepath Filepath and returns it as an ASCII string.

No example provided

table<string> syn_io_listdir(string Filedir)

Returns a table containing a directory's files.

No example provided

void syn_io_write(string Filepath, string Data)

Writes Data at Filepath and creates the file if it doesn't exist.

No example provided

void syn_io_delfile(string Filepath)

Deletes the file at Filepath.

No example provided

void syn_io_delfolder(string Filepath)

Deletes the directory at Filepath.

No example provided

bool syn_io_isfolder(string Filepath)

Returns whether the file at Filepath is a directory.

No example provided

void syn_io_append(string Filepath, string Data)

Appends Data to the file located at Filepath.

No example provided

Environment Library

table<ModuleScript> syn_getloadedmodules(void)

Returns a list of all ModuleScripts within the game.

No example provided

table syn_getgc(void)

Returns the Lua GC list. This can very easily leak memory if not used correctly.

No example provided

variant<table/nil> syn_getsenv(object<LocalScript/ModuleScript> Script)

Returns Script's environments. Returns nil if Script isn't running.

No example provided

table<BaseScript> syn_getscripts(void)

Returns a list of all scripts within the game.

No example provided

variant<LocalScript/ModuleScript/nil> syn_getcallingscript(void)

Returns the script calling the current function.

No example provided

table syn_getgenv(void)

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

No example provided

table<object> syn_getinstances(void)

Returns a list of all instances within the game.

No example provided

table syn_getreg(void)

Returns the Lua registry.

No example provided

table syn_getrenv(void)

Returns the global thread environment for the LocalScript context.

No example provided

table<BaseScript> syn_getnilinstances(void)

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

No example provided

table<BaseScript> syn_getrunningscripts(void)

Returns a list of all running scripts.

No example provided

Encryption Library

string syn_crypt_encrypt(string Data, string Key)

Encrypts Data with Key and returns it.

No example provided

string syn_crypt_hash(string Data)

Returns Data's hash.

No example provided

string syn_crypt_b64_encode(string Data)

Encodes Data in base64.

No example provided

string syn_crypt_b64_decode(string Data)

Decodes Data from base64.

No example provided

string syn_crypt_decrypt(string Data, string Key)

Decrypts Data with Key and returns it.

No example provided

Keyboard/Mouse Library

void syn_mouse1press(void)

Simulates a left mouse button press.

No example provided

void syn_mouse2click(void)

Simulates a full right mouse button press and release.

No example provided

void syn_keyrelease(int Keycode)

Simulates a key release for the specified keycode.

No example provided

void syn_mousemoverel(int X, int Y)

Moves the mouse cursor relatively by the specified coordinates.

No example provided

void syn_mousescroll(int Pixels)

Scrolls the mouse wheel virtually by Pixels pixels.

No example provided

void syn_mouse2release(void)

Simulates a right mouse button release.

No example provided

void syn_keypress(int Keycode)

Simulates a keypress for the specified keycode. For more information, click here.

No example provided

void syn_mouse1release(void)

Simulates a left mouse button release.

No example provided

void syn_mouse2press(void)

Simulates a right mouse button press.

No example provided

void syn_mouse1click(void)

Simulates a full left mouse button press and release.

No example provided

bool syn_isactive(void)

Returns true if the user is focused on the game window.

No example provided

Signal Library

void syn_fireclickdetector(object<ClickDetector> ClickDetector, <number/nil> Distance)

Fires the designated ClickDetector with distance provided. If distance isn't provided, it will default to 0.

No example provided

void syn_firetouchinterest(object<Part> Part, object<TouchTransmitter> Transmitter, number Toggle)

Fires the designated TouchTransmitter with Part. The Toggle argument is used to tell whether the Part is currently being touched.

No example provided

table syn_getconnections(void)

Returns a list of all connections within the game.

No example provided

Hooking Library

function syn_newcclosure(function Fn)

Pushes a CClosure that invokes Fn. Used for metatable hooks.

No example provided

function syn_hookfunction(function Target, function Hook)

Hooks Target and replaces it with Hook. Returns the unhooked function.

No example provided

Context Library

void syn_context_set(int Context)

Sets the current thread context to Context.

No example provided

int syn_context_get(void)

Returns the current thread context as an integer.

No example provided