Soldier.getSquad 73
Get the Squad that the soldier is currently in.
Notice: The squad might not be available immediatly after a soldier is spawned, so make sure to wait for it to be ready
Return value
Return Type | Description |
---|---|
Squad | Reference to the squad the soldier is currently in |
No parameters defined for this function.
Examples
Example 125
-- 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()