I want to kill a player once as soon as they join. Here is my code:
game.Players.PlayerAdded:connect(function(player)
game.Players.PlayerAdded:connect(function(player) --Waits for player
player.CharacterAdded:connect(function(char) --Waits for character
wait() --Waits so they can kill
char:WaitForChild("ForceField"):Destroy() --Destroys ForceField
char:WaitForChild("Humanoid").Health=0 --Sets Health to zero
end)
end)
end)
I do not understand why this is working. Can someone help?

1 comment
Quick tip, changing Humanoid HP directly (like when you did Health=0) goes through ForceFields, as they can only block TakeDamage() and explosions.