StartTimer - ScriptObject

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ScriptObject Script

Starts a real-time timer on this script with the specified ID. Will cause an OnTimer event to occur once the timer expires that will not repeat. Time will only count when not in menu-mode.

Syntax[edit | edit source]

Function StartTimer(float afInterval, int aiTimerID = 0) native

Parameters[edit | edit source]

  • afInterval: How long until the timer expires, in seconds.
  • aiTimerID: The ID of the real-time timer to start. The ID is unique per-script and will not conflict with game-time timers. If a timer with the same ID is already ticking down, it will reset the timer with the specified time.
    • Default: 0

Return Value[edit | edit source]

None.

Examples[edit | edit source]

; Start a 10 second timer with an ID of 0 on this script
StartTimer(10)


; Start a 5.5 second timer with an ID of 10 on this script
StartTimer(5.5, 10)

Notes[edit | edit source]

  • The time will be affected by the global time modifier. So if, for example, VATS fires off and slows down time, it will affect these timers as well.
  • Timers on ObjectReference scripts must have an explicit aiTimerID parameter, the default implicit timer ID 0 will never start.

See Also[edit | edit source]