Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I track players?

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

2 answers

You would use PlayerAdded Event:

Game.Players.PlayerAdded:connect(function(newPlayer) -- Connects when a player joins.
                 -- Code
end)

1 comment

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"

game.Players.PlayerAdded:connect(function(plr)
print(plr.Name) -- Make sure output is open when testing this.


end)

This discussion is preserved as it was. New answers, comments, and votes are closed.