-
Notifications
You must be signed in to change notification settings - Fork 1
Event bind
DizzasTeR edited this page Nov 1, 2020
·
2 revisions
Binds a function handler to an event.
bool Event.bind(string eventName, function handler)
- string eventName - The event to trigger
- function handler - The function that will be called when the event is triggered
bool - true if the event was successfully bound, false if something went wrong.
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)