Skip to content
DizzasTeR edited this page Nov 1, 2020 · 1 revision

Event Manager

cancel

Cancels an event from further signaling and possibly stop its effect (if supported)

bool Event.cancel()

Parameters

  • None

Returns

bool - Always returns true

Example #1

Event.bind("onServerInit", function()
    Logger.info("First!")
    Event.cancel() -- Cancel this event from going further
end)

-- This will not be triggered now
Event.bind("onServerInit", function()
    Logger.info("Second!")
end)

Example #2

Event.bind("onPlayerChat", function()
    Event.cancel() -- Chat won't be sent
end)
Clone this wiki locally