GlobalEvents
Last updated
Was this helpful?
Last updated
Was this helpful?
()
()
(current, old)
(interval)
(interval)
onStartup has no parameters, requires no return, and only runs once during the start of the server.
Example startup.lua
You can register in data/globalevents/globalevents.xml by using type="startup" like so:
onShutdown has no parameters, requires no return, and only runs once during the shutdown of the server
Example shutdown.lua
You can register in data/globalevents/globalevents.xml by using type="shutdown" like so:
onRecord has two parameters, requires return true, and runs each time a new record is made for most players online
current -- number value of new record, for most players online
old -- number value of old record, for most players online
Example record.lua
You can register in data/globalevents/globalevents.xml by using type="record" like so:
onTime has one parameter which represents the time it executes, requires return true, and runs each each day at same time
Example ontime.lua
You can register in data/globalevents/globalevents.xml by giving it a unique name and setting the time using time="time" like so:
onThink has one parameter which represents how often it executes in milliseconds, requires return true, and runs as often as specified in globalevents.xml
Example onthink.lua
You can register in data/globalevents/globalevents.xml by giving it a unique name and setting how often it will execute using interval="1000" time is in milliseconds
The above will execute every ten seconds 10 * 1000 = 10000