This doesn't work:
game.Players.PlayerAdded:Connect(function(player)
print(player.Name)
end)
But this does:
game.Players.PlayerRemoving:Connect(function(player)
print(player.Name)
end)
Does anyone know why this is?
This doesn't work:
game.Players.PlayerAdded:Connect(function(player)
print(player.Name)
end)
But this does:
game.Players.PlayerRemoving:Connect(function(player)
print(player.Name)
end)
Does anyone know why this is?
Unlike Normal Scripts, Local Scripts only run once the player has joined. Assuming that you have only joined with a single player, it is not going to work, as the event is connected after the player has joined.
Your script will only run for players that join after you.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
If you're just trying to reference the current player from the local script, you can do so with game.Players.LocalPlayer