playerID does not exist in current context?

void Awake () {
players = new GameObject[numPlayers];

	Player PlayerScript;
	PlayerScript = players[playerID].GetComponent<Player>();
	PlayerScript.playerID = playerID;
}

not sure why this isnt working, as a playerID variable is in the Player script.

playerID is just a variable on PlayerScript? You’re using a playerID variable too that should be defined on the same script.

What line gives you the error?

PlayerScript = players[playerID].GetComponent<Player>();

or

PlayerScript.playerID = playerID;

?

Try debugging this then proceed further

Player PlayerScript = players[playerID].GetComponent<Player>();
    
Debug.Log(PlayerScript.playerID);

Player class must have a public field playerID

public int playerID = 0;