Returns the players object associated with the Scavenger faction, even if Scavengers are disabled.

 

Syntax

var scavs = Players.scavenger; // returns scav players object

Return value

The Players Object associated with the Scavenger faction.

Notes

The Players Object will be returned even if Scavengers are not present on the map.

This is useful because the players object's .isAlive property is a much more accurate and concise way to determine if there are Scavengers roaming the map than using the native scavengers and scavengerPlayer globals:

  • It checks to see if Scavengers are enabled on the map first
  • If they are, it checks to see if they actually have any structures or droids
  • The result is cached to keep performance high

(warning) Scavengers don't have a start position, so:

Players.scavenger.position == undefined

Example

var scavsRoamingMap = Players.scavenger.isAlive;
Availability

Requires:

Contents

Jump to:

See also

Related articles:

Players API

Topics: