Mod:Creation Kit/OnTimer - ScriptObject

Member of: Mod:Creation Kit/ScriptObject Script

Event called once a real-time timer started on a script expires. This event will not be sent if the game is in menu mode.

Syntax
Event OnTimer(int aiTimerID)

Parameters

 * aiTimerID: The ID number of the timer which just expired.

Example
int myCoolTimerID = 10 ; Give our timer an ID we can remember

Function SomeFunction StartTimer(5, myCoolTimerID) ; Create the timer with a 5 second duration EndFunction Event OnTimer(int aiTimerID) If aiTimerID == myCoolTimerID ; The five second timer we started just expired Debug.Trace("Timer ended! Do some cool stuff now...") ; If we wanted to have the timer start over, we could now do StartTimer again... EndIf EndEvent