You can register in data/globalevents/globalevents.xml by using type="shutdown" like so:
onRecord(current, old)
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
Examplerecord.lua
You can register in data/globalevents/globalevents.xml by using type="record" like so:
onTime()
onTime has one parameter which represents the time it executes, requires return true, and runs each each day at same time
Exampleontime.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()
onThink has one parameter which represents how often it executes in milliseconds, requires return true, and runs as often as specified in globalevents.xml
Exampleonthink.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
function onRecord(current, old)
addEvent(Game.broadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
return true
end