How do you identify between players on a multiplayer server?

Hi,

I am making a multiplayer game where I want to be able to differentiate between the different users for certain tasks. I’ve explored using player tags or player ID numbers but am unsure on how to properly implement this across a server.

Basically when the game loads say there are 4 players. I want to be able to make it so players are randomly dealt either a red, green, blue or yellow tag. So one player is the red player, one is the green player etc.

Then during the game around the map the red player is only able to trigger certain events. So a specific button can only be triggered by the red player and another button can only be triggered by the green player.

Any suggestions on how to implement this would be greatly appreciated.