SetMinuteDuration
Jump to navigation
Jump to search
setMinuteDuration
Changes the authoritative speed of the in-game clock.
Syntax
bool setMinuteDuration(int durationMs)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
durationMs |
int |
yes | Real milliseconds per in-game minute, from 0 to 3600000. Use 0 to pause the clock. |
Returns
Returns true when the duration is accepted; otherwise returns false.
Examples
Example 1
Make one in-game minute last two real seconds:
setMinuteDuration(2000)
Example 2
Pause and later resume the clock:
setMinuteDuration(0)
-- Resume at one real second per game minute.
setMinuteDuration(1000)
Notes
- Available only in server-side resource scripts.
- A successful change triggers
onMinuteDurationChangeand is replicated to all clients.