I think i got something wrong. I put this local script into Players but it's not working. No errors in the output.
1 | local Players = game:GetService( 'Players' ) |
2 | local Player = Players.LocalPlayer |
3 | local humanoid = Player:WaitForChild( "Humanoid" ) |
4 |
5 |
6 | humanoid.Died:Connect( function () |
7 | Player:Kick( "you died" ) |
8 | end ) |
put the following Local script in Starter CharacterScripts and use the following code. It would surely work.
1 | local player = game.Players.LocalPlayer |
2 | local Humanoid = player.Character.Humanoid |
3 |
4 | Humanoid.Died:Connect( function () |
5 |
6 | player:Kick( "You Died" ) |
7 |
8 |
9 | end ) |