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 4 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.

local Players = game:GetService('Players')
local Player = Players.LocalPlayer
local humanoid = Player:WaitForChild("Humanoid")


humanoid.Died:Connect(function()
    Player:Kick("you died")
end)

1 answer

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

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

local player = game.Players.LocalPlayer
local Humanoid = player.Character.Humanoid

Humanoid.Died:Connect(function()

    player:Kick("You Died")


end)
Ad

Answer this question