Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make Character that respawns?

How would make a script that allows my custom character to respawn in the same position after death? This is what I have.

wait() local Humanoid = script.Parent.Humanoid local char = script.Parent local Player = game.Players.LocalPlayer

Humanoid.HealthChanged:Connect(function(Health) if Health <= 0 then local area = char.HumanoidRootPart.CFrame Player.Character = char wait(5) Player:LoadCharacter() char.HumanoidRootPart.CFrame = area end end)

1 comment

0

It is a local script inside of the character.

2 answers

There are a few script errors I have tried this script and it worked. Try this. name="Humanoid"

robo=script.Parent:clone()

while true do wait(1) if script.Parent.Humanoid.Health<1 then robot=robo:clone() robot.Parent=script.Parent.Parent robot:makeJoints() script.Parent:remove() end end

Tell me if it fails I'll try and make a new script if it fails.

1 comment

0

Thank you so much, I will try and do this now. I have inspected the script, and it works perfectly except for one tiny problem, when the character respawns, it isn't made the Local player's character and it's spawn location isn't where it once was.

Hey aeco_ux. LoadCharacter() does not work on the client.

1 comment

0

I see, I will try another way, thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.