Return value#

Type Meaning
unknown Registration return is not established. Callback arguments belong to the specific event, rather than RegisterEvent itself.

Types and methods

Observed form#

Layer: game Lua UI. name identifies the received event; callback processes its arguments.

LUA
RegisterEvent(name, callback)

Example reply from MD#

The first argument is intentionally ignored in the example. The payload is the second argument on this raise_lua_event route. Do not apply that signature to every internal game event without checking its contract.

LUA
RegisterEvent("Wiki.Pong", function(_, payload)
    if payload ~= "pong" then
        return
    end
    -- Ответ распознан. При необходимости обновите своё состояние.
end)

What happens: A callback is registered for Wiki.Pong. With payload = "pong" it reaches the comment; this example has no further action or printed output.

Lifecycle#

Do not install a new handler on every frame. Old adapter callbacks may need a current-instance check after replacement. Instance validity and window cleanup must follow the UI lifecycle: Lua UI.