Will game.Players:GetPlayers()[1] ever change values?

Will game.Players:GetPlayers()[1] stay the same player no matter how many players join?
I know that if a player leaves it may change but I want to know if it will change when players join?

Yes.

Researching further it seems it is because Get Players is similar to :GetChildren() but specifically for players.

Documemtatiom Players | Roblox Creator Documentation

It functions the same way Instance:GetChildren would except that it only returns Player objects. It functions similarly to Instance:GetChildren when called on Players .

And from there get children is well it’s odd, it is ordered yet not guranteed so best bet is to assume it will change values.

1 Like

Ok I’ll just set a value in serverstorage to the first player Thanks :smiley:

Save join times on the server, but don’t literally put something in ServerStorage. ServerStorage is mainly for instances you intend to clone into existence during gameplay. Something like join times should just be kept in a Lua table.

1 Like

Yeah I’ll do that instead Thanks

What I’m doing is storing a value in serverstorage and replicated storage that is set to the player who first joined so that other scripts in the game can reference it