addEvent
Client-side
Server-side
Shared
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function allows you to register a custom event. Custom events function exactly like the built-in events. See event system for more information on the event system.
Syntax
addEvent ( )Code Examples
server
This example will define a new event calledonSpecialEvent.
-- Add a new event called onSpecialEventaddEvent ( "onSpecialEvent", true )
-- Define our handler function, that takes a "text" parameter and outputs it to the chatboxfunction specialEventHandler ( text ) outputChatBox ( text )end
-- Add it as a handler for our eventaddEventHandler ( "onSpecialEvent", root, specialEventHandler )