SetMinuteDuration: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 36: | Line 36: | ||
* A successful change triggers <code>onMinuteDurationChange</code> and is replicated to all clients. | * A successful change triggers <code>onMinuteDurationChange</code> and is replicated to all clients. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:World Functions]] | [[Category:World Functions]] | ||
Latest revision as of 09:55, 15 August 2026
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.