Synapse X API
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
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_checkcaller(void)
Returns true if the current thread is owned by Synapse X.
No example provided
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_name(string Name)
Set the currently allocated console's title to Name.
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
variant<table/nil> getrawmetatable(variant<table/userdata> Value)
Retrieves the metatable of value if it exists, or return nil.
No example provided
bool table.islock(table T)
Returns true or false depending if T is locked or not.
No example provided
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
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
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_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
string syn_crypt_encrypt(string Data, string Key)
Encrypts Data with Key and returns it.
No example provided
string syn_crypt_decrypt(string Data, string Key)
Decrypts Data with Key and returns it.
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_keypress(int Keycode)
Simulates a keypress for the specified keycode. For more information, click here.
No example provided
void syn_mouse1click(void)
Simulates a full left mouse button press and release.
No example provided
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
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