Get the current value of the mission timer... |
var time = getMissionTime(); |
No parameters.
Value | Type | Notes | Game Version |
---|---|---|---|
<time> | Number | The amount of mission time remaining, in seconds. | 3.2 |
-1 | Number | The timer is not active. | 3.2 |
<error> | Error | Invalid parameters. | 3.2 |
When the mission timer reaches 0, eventMissionTimeout() is triggered and the game will continue unless instructed otherwise within the event handler.
It's common to play audio prompts (using playSound() function) to let the user know how long is left on the timer – a list of audio files can be found in the sidebar to the right... →
var timeRemaining = getMissionTime(); if (timeRemaining == -1) { // timer is not active } else if (timeRemaining == 0) { // mission timed out, eventMissionTimeout() will have been triggered } else { // there is timeRemaining seconds left on the timer } |
Availability Requires:
|
ContentsJump to: |
See alsoRelated articles:
Audio files for countdowns: |