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

[ SOLVED ] How can I make the character rejoin when the character dies?

Asked by 4 years ago
Edited 4 years ago

I mean if someone dies, the game kick him/her.

0
So when all the pieces all apart, you want them put back together..? EH2019SIT 78 — 4y
0
Huh? This is not clear at all... zadobyte 692 — 4y
0
I mean if someone dies, the game kick him/her. fatih1106 5 — 4y
0
I would use events when someone dies, the event plays a kick script. EH2019SIT 78 — 4y
0
please fucking accept EH's answer if he helped...thats what the features there for zadobyte 692 — 4y

2 answers

Log in to vote
0
Answered by
zadobyte 692 Moderation Voter
4 years ago
local plr = game.Players.LocalPlayer
local char = plr.Character or CharacterAdded:Wait()

char:WaitForChild("Humanoid").Died:Connect(function()
    plr:Kick("Died")
end)
Ad
Log in to vote
1
Answered by 4 years ago
local Delay = 2
local Reason = ""

game:GetService("Players").PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        Character:WaitForChild("Humanoid").Died:Connect(function()
            wait(Delay)
            Player:Kick(Reason)
        end)
    end)
end)

With a delay.

0
Thanks. fatih1106 5 — 4y
0
im so sorry you have to deal with such pain EH zadobyte 692 — 4y
0
Took some digging to see what he meant. I just guessed EH2019SIT 78 — 4y

Answer this question