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

How to make players teleport to their death point/previous location?

Asked by 6 years ago

I have some ideas, but I doubt they'll work. Any ideas?

0
At least post the ideas man theCJarmy7 1293 — 6y

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
6 years ago

Save their last position on Humanoid.Died, wait for their character to load using CharacterAdded:Wait() and then teleport them back to where they were.

game:GetService("Players").PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        local hum = char:WaitForChild"Humanoid"
        hum.Died:Connect(function()
            local pos = char.HumanoidRootPart.Position
            plr.CharacterAdded:Wait():WaitForChild("HumanoidRootPart").CFrame = CFrame.new(pos)
        end)
    end)
end)
0
Omg thank you! RibgyTheRacoon 67 — 6y
Ad

Answer this question