- Documentation
- Shared functions
- setMinuteDuration
Function
setMinuteDuration
Sets how many milliseconds one game clock minute lasts (1000 by default, so a game day lasts 24 minutes). A higher value = a slower day.
Syntax
bool setMinuteDuration(int milliseconds)Arguments
millisecondsint- Minute length in ms (at least 1).
Returns
true on success.
Example
A game day lasts as long as a real one.
setMinuteDuration(60000)
local t = getRealTime()
setTime(t.hour, t.minute)
Notes
Client. In a client script - clock pace for this player only (the clock then runs locally from the current time). Back: resetMinuteDuration, or setTime / setMinuteDuration on the server.
See also
getMinuteDurationReturns the game clock minute length in milliseconds.setTimeSets the in-game time for every player. From then on the clock keeps running by itself (unless it is stopped withsetTimeFrozen); one game minute lasts one second by default (setMinuteDuration). The time of day changes the lighting, the sky colour and whether it is dark.resetMinuteDurationEnds the local minute length set withsetMinuteDurationin a client script: the clock goes back to the server's time and pace.