-
Notifications
You must be signed in to change notification settings - Fork 1
Event trigger
DizzasTeR edited this page Nov 1, 2020
·
2 revisions
Triggers an event, custom or not.
bool Event.trigger(string eventName [, ...optionalParameters])
- string eventName - The event to trigger
- optional parameters - Any number of optional parameters that should be forwarded
bool - true if the event was successfully triggered, false if something went wrong.
Event.create("myEvent")
Event.bind("myEvent", function(myNum, ...)
Logger.info("myEvent! Number: "..tostring(myNum))
end)
Event.bind("onServerInit", function()
Event.trigger("myEvent", 10) -- trigger my custom event
end)