Soldier.isSquadReady 60

Check if soldier is in a squad, and the squad is marked as ready to receive orders.
Notice: A squad might not be ready immediately after a soldier has spawned, so this can be used to check whenever the soldier is in a squad before getting the squad reference


Return value

Return TypeDescription
boolTrue if the soldier is in a squad and the squad is spawned and ready to receive orders

No parameters defined for this function.


Examples

Example 124

-- get soldier reference
local soldier = myself()

-- wait for soldier's squad to be ready
local squadready_condition = function() return soldier.isSquadReady() end
waitUntil(squadready_condition)

-- finally, get the squad reference
local squad = soldier.getSquad()

Back to Scripting API