Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:3.3

Description

Description:Executes the defined code after a specified delay.

Syntax

Syntax:delayCall [delay, code, arguments, interruptible]
Parameters:
  • delay: Number - Delay (in seconds), after which the code should be executed. Delays of 0 or less cause immediate execution.
  • code: Code - Script command(s) to execute. The elements passed using arguments can be accessed using the _this variable.
  • arguments: Anything - Parameters to pass to the code section.
  • interruptible: Boolean - If true, then code can be interrupted by engine scheduling (like regular scripts, called by execVM). If false, then it is executed without interruptions (optional, default: true).
Return Value:Script (Handle)

Examples

Examples:
Outputs the player name as a hint:
delayCall [5, {hint ("Hello, "+name _this)}, player]

Outputs the three numbers passed as an array, and then the line "done":
delayCall [2,{{player sidechat str _x}forEach _this; hint "done"}, [3,2,1]];

Additional Information

See also: delayUICall, execVM, call
Multiplayer: 
Problems: 

Notes