game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
print(player.Name .. " has died!")
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
Player:kick("You died!")
end)
end)
end)
I made this script to detect when you die, then kick you but its not working, can i get help?

1 comment
you can delete line 4 all it does is prints the player has died