game.Players.PlayerAdded:connect(function(player)
print(player.Name.." ".."has joined")
repeat wait() until player.Character.Head
player.Character.Humanoid.Died:connect(function()
print(player.Name.." ".."has died")
end)
end)
✓ ANSWER ACCEPTED
how can i make this piece of code loop all the time instead of once?
2 answers
✓ Accepted answer
Use "While true do"
game.Players.PlayerAdded:connect(function(player)
print(player.Name.." ".."has joined")
player.CharacterAdded:connect(function(char) --fires every time the player respawns.
print(player.Name.." ".."has spawned")
char.Humanoid.Died:connect(function()
print(player.Name.." ".."has died")
end)
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
thanks, i never knew abou the character added function and that it fires every time a player spawns
Same.