OnTimeChange
onTimeChange
Triggered after the server changes the authoritative world clock.
Availability
This event is available in server-side scripts.
Callback signature
onTimeChange(hour, minute, day, sourceResource)
Parameters
| Name | Type | Description |
|---|---|---|
hour |
int |
World hour from 0 through 23. |
minute |
int |
World minute from 0 through 59. |
day |
int |
Authoritative world day. |
sourceResource |
string |
The resource that requested the change. |
Examples
Handle the event:
addEventHandler("onTimeChange", root, function(hour, minute, day, sourceResource)
outputDebugString(string.format("World time: day %d, %02d:%02d", day, hour, minute))
end)