events
Event registration and dispatch for scripts to hook engine/game lifecycle moments via cheat.Register.
onUpdate
Section titled “onUpdate”cheat.Register("onUpdate", function() ... end)
Fires every engine frame tick, the fast per-frame update loop.
cheat.Register("onUpdate", function() -- runs every frameend)onSlowUpdate
Section titled “onSlowUpdate”cheat.Register("onSlowUpdate", function() ... end)
Fires on a slower, throttled update cadence for less time-sensitive polling work.
cheat.Register("onSlowUpdate", function() -- runs on a throttled cadenceend)onPaint
Section titled “onPaint”cheat.Register("onPaint", function() ... end)
Fires once per rendered overlay frame, for draw-related script logic.
cheat.Register("onPaint", function() -- runs once per overlay paintend)newPlace
Section titled “newPlace”cheat.Register("newPlace", function() ... end)
Fires when the game’s DataModel resolves to a new place, e.g. after a server hop or teleport.
cheat.Register("newPlace", function() print("joined a new place")end)characterAdded
Section titled “characterAdded”cheat.Register("characterAdded", function() ... end)
Fires when the local player’s Character instance appears. Detection is polled and only runs while a handler is registered for this event.
cheat.Register("characterAdded", function() print("character spawned")end)characterRemoving
Section titled “characterRemoving”cheat.Register("characterRemoving", function() ... end)
Fires when the local player’s Character instance is about to be removed, detected via polled detection.
cheat.Register("characterRemoving", function() print("character despawning")end)shutdown
Section titled “shutdown”cheat.Register("shutdown", function() ... end)
Fires when the external tool is shutting down, for cleanup work. A shutdown handler on its own does not keep a script resident.
cheat.Register("shutdown", function() print("cleaning up")end)cheat.Register
Section titled “cheat.Register”cheat.Register(eventName: string, handler: function): void
Registers a handler function to be called whenever the named event fires; unknown event names raise a Lua error.
cheat.Register("onUpdate", function() -- handler bodyend)cheat.GetWindowSize
Section titled “cheat.GetWindowSize”cheat.GetWindowSize(): (width: number, height: number)
Returns the current game camera viewport size in pixels, or (0, 0) if it cannot be resolved.
local w, h = cheat.GetWindowSize()print(w, h)