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

Event Manager

bind

Binds a function handler to an event.

bool Event.bind(string eventName, function handler)

Parameters

  • string eventName - The event to trigger
  • function handler - The function that will be called when the event is triggered

Returns

bool - true if the event was successfully bound, false if something went wrong.

Example

function myOnServerStart()
    Logger.info("Server started!")
end
Event.bind("onServerInit", myOnServerStart) -- bind a handler

Event.bind("onServerInit", function() -- bind an anonymous function
    Logger.info("The server init event was triggered!")
end)
Clone this wiki locally