waitUntil 109
Pause the execution of the script until one or multiple conditions are met.
Return value
Return Type | Description |
---|---|
void | This function doesn't return anything |
Parameters
Parameter | Type | Description |
---|---|---|
1 | function | One 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!")