local plr = game.Players.LocalPlayer
game.Players.ChildAdded:connect(function()
print "Player has joined!"
end)
The
game.Players.ChildAdded:connect(function()
end)
is the part that's not working.
local plr = game.Players.LocalPlayer
game.Players.ChildAdded:connect(function()
print "Player has joined!"
end)
The
game.Players.ChildAdded:connect(function()
end)
is the part that's not working.
Line 1 suggests that this is a LocalScript. The problem with PlayerAdded/ChildAdded in LocalScripts is that the player is added to game.Players before that player's LocalScripts start running.
Just take out the PlayerAdded/ChildAdded code (that is, lines 3 and 5 in your sample script).
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Is it in a ServerScript in ServerScriptService?
You need to instead use PlayerAdded because ChildAdded does not work for the Players instance.