waitUntil 109

Pause the execution of the script until one or multiple conditions are met.


Return value

Return TypeDescription
voidThis function doesn't return anything

Parameters

ParameterTypeDescription
1functionOne or multiple functions to check condition for

Examples

Example 36

-- get a soldier (uncomplete)
local soldierToKill1 = spawnSoldier(....)

-- create a condition that waits for him to die
local condition1 = function() return not soldierToKill1:isAlive() end

-- wait for the condition to be true
waitUntil(condition1)

-- print result
print("Soldier is dead!")

Back to Scripting API