đŸ—ŗī¸events

Functions:

Available cheat events can be found here.

:set

events.event_name:set(callback: function)

Sets the callback for the specified event. The registered function will be called every time the specified event occurs.

:unset

events.event_name:unset(callback: function)

Unsets the callback that was set via the :set function from the specified event.

:call

events.event_name:call(...)

Fires the specified event.

Alternative behavior:

:__call

events.event_name(callback: function[, state: boolean])

Sets / unsets the callback for the specified event.

local function function_callback()
    print(globals.tickcount)
end

-- Sets the createmove callback for the specified function
events.createmove(function_callback)

-- Execute after 0.5 secs
utils.execute_after(0.5, function()
    -- Toggles the createmove callback for the specified function
    events.createmove(function_callback)
end)

Last updated