Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with kick player on death script please?

Asked by 5 years ago

I think i got something wrong. I put this local script into Players but it's not working. No errors in the output.

1local Players = game:GetService('Players')
2local Player = Players.LocalPlayer
3local humanoid = Player:WaitForChild("Humanoid")
4 
5 
6humanoid.Died:Connect(function()
7    Player:Kick("you died")
8end)

1 answer

Log in to vote
0
Answered by
hallmk7 50
5 years ago

put the following Local script in Starter CharacterScripts and use the following code. It would surely work.

1local player = game.Players.LocalPlayer
2local Humanoid = player.Character.Humanoid
3 
4Humanoid.Died:Connect(function()
5 
6    player:Kick("You Died")
7 
8 
9end)
Ad

Answer this question