Players.me

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

Players.me

Returns the player object associated with your script.

 

Syntax

var myObj = Players.me; // returns my players object

Return value

The Players Object associated with your script.

Notes

This will always return the Players Object associated with player me, in other words the player your script is bound to.

If your script is associated with a human player (eg. rules.js) remember that the human can use the Debug Menu to switch to another player, but the value of me will remain unchanged. If you want the player object of the player the human is currently controlling, use Players[selectedPlayer] instead (see example below).

Example

Get players object associated with my script
// players object associated with your script var myObj = Players.me;   // players object for whichever player the local human is looking at var localHumanObj = Players[selectedPlayer];