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

Why this script respawns the humanoid uncorrectly? (Unsolved)

Asked by 10 years ago
c = script.Parent:Clone()
h = script.Parent.Head
ha = nil

script.Parent.Zombie.Died:connect(function ()
    script.Parent.FloatScript:Destroy()
    script.Parent.ZephyrShoot:Destroy()
    script.Parent.ZephyrFollowScript:Destroy()
    script.Parent.ZephyrLookScript:Destroy()
    script.Parent:FindFirstChild("Torso").BodyPosition:Destroy()
    wait(2)
    if script.Parent:FindFirstChild("Head") then
        h = script.Parent.Head
    end
    h.Transparency = 1
    script.Parent.Torso.Transparency = 1
    h.Anchored = true
    script.Parent.Torso.Anchored = true
    h.CanCollide = false
    script.Parent.Torso.CanCollide = false
    local d = script.Parent.Hat:GetChildren()
    for i, v in ipairs (d) do
        if v.ClassName == "Part" then
            v.Transparency = 1
            v.Anchored = true
            v.CanCollide = false
            if v:findFirstChild("Smoke") then
                v.Smoke:remove()
            end
        end
    end
    wait(5)
    c:MakeJoints()
    c.Hat.AutoWeld.Disabled = true
    c.Hat.AutoWeld.Disabled = false
    c.AutoWeld.Disabled = true
    c.AutoWeld.Disabled = false
    c.Parent = Workspace
    c.AutoWeld.Disabled = true
    c.AutoWeld.Disabled = false
    c.Hat.AutoWeld.Disabled = true
    c.Hat.AutoWeld.Disabled = false
    c.Zombie.Health = c.Zombie.MaxHealth
    script.Parent:remove()
end)

So, what this does is that it respawns the humanoid. The humanoid doesnt have a humanoid look/form. It has multiple parts welded to eachother, the torso and the head is in the humanoids model and the rest of the parts are inside a hat welded. The problem with this script is that it respawns, but, like thats classic roblox respawn bug, it respawns the humanoid dead. How do i make it respawn the humanoid alive at 100% chance?

1 answer

Log in to vote
0
Answered by 10 years ago

MakeJoints() only connects parts that are connected with apropriate surfaces. Since you used welds for body parts, you'll need to reweld everything again in correct positions, and place head back on torso and then connect both of those. Otherwise it won't work.

0
Well, thats what the autoweld script does, i made that is disables and enables the script so the autoweld can weld the parts DragonOfWar900 397 — 10y
0
That won't work, unless that autoweld has preset CFrames, otherwise it will just weld the parts to torso in their scattered form. It would be easier to spawn new charcter, and delete this one. ZarsBranchkin 885 — 10y
Ad

Answer this question