Script SetTimerForFunction

From CryWiki

Jump to: navigation, search

Script.SetTimerForFunction(number, string, [ args ])

Description

Executes a function after a specified amount of time.

Arguments

  1. Time in milliseconds until the function executes
  2. Function to execute (as string)
  3. (optional) Extra arguments for the function


Example

Lua (example)
-- Spawns a vehicle on the players position after 2 seconds
-- The position is set at the time of executing SetTimerForFunction, not when actually spawning the entity
Script.SetTimerForFunction(2000, "System.SpawnEntity", {class="US_ltv", position=g_localActor:GetPos()});


See also

Script.SetTimer

Personal tools