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

How do I revive/respawn dummies after they die?

Asked by 3 years ago
Edited 3 years ago

I need to respawn/revive a dummy but don't know-how. Could someone push me in the right direction?

repeat
    if game.Workspace.Dummy1.Humanoid.Health < 100 then
        game.Workspace.Dummy1.Humanoid.Health += 100
    end 
    wait(0.15)
until true == false
0
Create a copy of dummy right after it spawns like Dummy:Clone() and after it dies (use Humanoid.Died event instead of loop pls), you remove old dummy and clone the copy and parent it to old dummy's parent. simple imKirda 4491 — 3y
0
I was thinking of this and didn't know how to execute it so thanks! XbloxKing21 0 — 3y
0
What you said to do didn't work imKirda I need you to evaluate more on what to do please XbloxKing21 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

clone it before it dies, or when it respawns/spawns.

clone = script.Parent:Clone()

then when it dies respawn it and wait for a period of time and eventually delete the dead one if you want.

script.Parent.Humanoid.Died:Connect(function()

    wait(10)
    clone.Parent = workspace

    wait(20)
    script.Parent:Destroy()

end)
Ad

Answer this question