syn

Documentation of Synapse Z syn library

syn.killprocess

void syn.killprocess(exit_code: number?)

kills roblox process with optional exit code

syn.trampoline_call

void syn.trampoline_call(target: function, callstack: table, options: table)

calls the target function on a new thread with the specified callstack and options, callstack is a list of tables with fields:

FieldTypeDescription
funcfunctionif specified would overwrite all other options (excluding currentline)
sourcestringchunkname of the function
namestringname of the function
numparamsnumbernumber of function parameters
is_varargnumberis function variadic
nupsnumbernumber of function upvalues
envtablefunction environment
currentlinenumbercurrent line the function is being executed on

options is a table with the following fields:

FieldTypeDescription
threadthreadthe thread to create a new thread from
scriptScriptthe script that the new thread will be assigned
envtableenvironment of the new thread
identitynumberidentity of the new thread
NOTE: trampoline_call cannot yield when callstack is provided

syn.protect_gui

void syn.protect_gui(gui: ScreenGui)

would automatically reparent the gui to gethui() when Parent is assigned

syn.unprotect_gui

void syn.unprotect_gui(gui: ScreenGui)

removes the gui protection

syn.get_auroraservice

AuroraService syn.get_auroraservice()

returns AuroraService, mostly a joke function

syn.sandbox

thread syn.sandbox(target: <Script/function>, callback: function)

runs target on a new sandboxed thread which calls callback on each luau instruction execution

syn.sandbox(function()
    warn("evil world")
    error()
end, function(pc, op, A, B, C, D, E)
    if pc == 2 then
        debug.setstack(2, 1, print) -- replace warn function with print
    elseif pc == 3 then
        debug.setstack(2, 2, "hello world") -- replace "evil world" with "hello world"
    elseif pc == 6 then
        return true -- skip error call
    end
end)

syn.spoof_memory_begin

void syn.spoof_memory_begin()

creates a copy of current memory usage and backups it when syn.spoof_memory_end is called

syn.spoof_memory_end

void syn.spoof_memory_end()

backups memory usage counter since syn.spoof_memory_begin call

syn.get_instance_count

void syn.get_instance_count()

equal to stats().InstanceCount

syn.set_instance_count

void syn.set_instance_count(count: number)

sets stats().InstanceCount to the specified count