The "timer_set" Function

Syntax

timer_set(id, duration, [instance]);
ArgumentTypeDescription
idstringThe unique timer ID to modify, as a string (or keyword all for all local timers)
durationrealSets the duration of time to countdown, in seconds
[instance]instanceOptional: Sets the object instance containing the timer to modify (use none for self)

Description

Overrides the current time in the specified timer, restarting the countdown process. If the timer does not exist, it will be created, but not countdown.

Note that if this script is run in an event that is executed every frame (e.g. Step), the timer will be unable to countdown! If this is required, use an 'if' statement to only set the timer under certain conditions.

Example

timer("t_alarm", 5);
timer("t_other", 5, my_other_inst);