client
The client namespace provides core controls for registering callbacks, delayed execution, log printing, and self-managing script lifecycle.
Methods
Section titled “Methods”client.add_callback
Section titled “client.add_callback”client.add_callback(event: string, fn: function)Registers an event callback function. See the Callbacks Guide for complete details and event signatures.
event: Name of the callback hook (e.g."render","createmove","antiaim","game_events","aim_ack").fn: The callback function to execute when the event fires.
client.add_callback("render", function() -- Drawing logic hereend)client.remove_callback
Section titled “client.remove_callback”local removed = client.remove_callback(event: string, fn: function) --> booleanRemoves a previously registered callback matching the given function handle.
- Returns
trueif a matching callback was found and removed; otherwisefalse. - Removing a callback during its own dispatch takes effect on the next event cycle.
client.delay_call
Section titled “client.delay_call”client.delay_call(seconds: number, fn: function, ...)Schedules a function to run after a specified monotonic wall-clock delay in seconds.
- Timers persist across map changes and engine pauses.
- Any arguments passed after
fnare forwarded to the function upon execution. - Pending timers are automatically cancelled if the script unloads before execution.
client.delay_call(2.5, function(msg) print("Delayed message: " .. msg)end, "Hello after 2.5s")client.unload_script
Section titled “client.unload_script”client.unload_script()Unloads the calling script instance.
client.reload_script
Section titled “client.reload_script”client.reload_script()Unloads and immediately reloads the calling script instance from disk.
client.color_log
Section titled “client.color_log”client.color_log(r: number, g: number, b: number, ...)Prints a colored log line to the cheat console with the specified RGB values (0..255).
- Pass a trailing
"\0"string argument to suppress the trailing newline, allowing multiplecolor_logcalls to compose a single multicolored console line.
client.color_log(255, 100, 100, "Red prefix ", "\0")client.color_log(100, 255, 100, "Green suffix\n")