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

How do you detect if a new player joins a game?

I think the method is NewPlayer, don't know if that is even a method. I tried almost every method but failed for my script. Can someone help.

3 comments

0

New player as in new to the game or new to the server?

0

New to the server, like they just joined.

0

Perci1's answer should do then

1 answer

✓ Accepted answer

There's a PlayerAdded event of Players that does exactly what you're looking for. When a player joins the game, this event will fire.

With an anonymous function

game.Players.PlayerAdded:connect(function(plr)
	print(plr.Name)
end)

With a normal function

function newPlayer(plr)
	print(plr.Name)
end
game.Players.PlayerAdded:connect(newPlayer)

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