Players.dead[]

(info) This AI is still in early stages of development.

Players.dead[]

Returns an array of players objects for dead players.

 

Syntax

var defeated = Players.dead; // array of defeated players objects

Return value

An array of defeated Players Objects, including Scavengers (if applicable), excluding spectators and vacant slots.

Notes

The indexes in the array are sequential and not based on player IDs.

Uses caching to boost performance. The cache is automatically invalidated every game tick. See Cache API for details.

Example

Iterating through corpses
Players.dead.forEach(function(corpse) { // corpse = players object for current dead player // corpse.id = id of dead player });
Check if specific player is dead
// note: treats spectators and vacant slots as dead var isDead = !Players[playerID].isAlive;