Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I track players?

Asked by
boy1dr 0
10 years ago

for example, if a player joins how would a know? how would I know the person's username?

2 answers

Log in to vote
1
Answered by 10 years ago

You would use PlayerAdded Event:

Game.Players.PlayerAdded:connect(function(newPlayer) -- Connects when a player joins.
                 -- Code
end)
0
I like your answer, but you should add how the functions "p" is the player. More commonly, the last bits look like "(function(newPlayer)" and the newPlayer is equal to "game.Players.*PlayerName*" AmericanStripes 610 — 10y
Ad
Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
game.Players.PlayerAdded:connect(function(plr)
print(plr.Name) -- Make sure output is open when testing this.


end)

Answer this question