Photon GetPlayerNumber returning -1

I was working on a tag script, but for some reason, the GetPlayerNumber function returns -1 when it should give 1.

Here is the part of the script that controls the player number:

[PunRPC]
void StartTag()
{
    firstTagger = Random.Range(0, PhotonNetwork.PlayerList.Length);
    playerNumber = PhotonNetwork.LocalPlayer.GetPlayerNumber();
}