Scripting
Script Structure
onStartup()
function onStartup() print("Game server has started.") return true end
onShutdown()
function onShutdown() for _, player in pairs(Game.getPlayers()) do -- Send FYI box, text messages won't go through before player is kicked player:popupFYI("Server is shutting down.") end end
onTime()
-- <globalevent time="12:00" script="this_script.lua" /> function onTime(time) print("Event is being executed at 12:00!") end
onThink(interval)
function onThink(interval) for _, player in pairs(Game.getPlayers()) do player:sendTextMessage(MESSAGE_INFO_DESCR, "Your name is " .. player:getName()) end return true end
onRecord(current, old)
function onRecord(current, old) Game.broadcastMessage("New player count record: " .. current) return true end
Last updated