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

(Read Body Because Title was too long) How do I fix this?

Asked by 4 years ago

So, when a player dies, and a part of them (Ex. Torso, Head etc.) hits a different checkpoint, they spawn on the checkpoint that they hit, instead of the one they came from. How do I fix this?

2 answers

Log in to vote
0
Answered by 4 years ago

Try destroying the humanoid's body parts to prevent them from touching when the player dies:

game.Players.PlayerAdded:Connect(function(player)
    local character = player.Character or player.CharacterAdded:Wait() -- if the character doesn't exist, we'll wait until it does
    local humanoid = character:WaitForChild("Humanoid")
    humanoid.Died:Connect(function()
        for _, bodyPart in pairs(character:GetChildren()) do -- loop :GetChildren() to destroy them all
            bodyPart:Destroy() -- destroy the parts
        end
    end)
end)

Hope this helps!

0
You can also turn off break joints in the humanoid property to prevent the parts from falling off. AlmostADemon 50 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

One solution for this problem is to have the checkpoints detect if the player is dead. So like when the checkpoint is touched make sure ..Character.Humanoid.Health > 0 to set their checkpoint. This should do the trick!

Answer this question