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

Zombie dying when being moved?

Asked by 8 years ago

I am making a Tower Defense game where a zombie is located in a folder inside of Lighting inside of Workspace. The Zombie is alive if directly placed in workspace and not being moved, but for some reason when I try to move the zombie from lighting to workspace the Zombie's health reaches zero. Heres the script:

local zombies=game.Lighting.Folder1
script.Parent.Round.Changed:connect(function(round)
    if round==1 then
        for i = 1, 10 do
            local enemy=zombies.Zombie:Clone()
            wait(1)
            enemy.Parent=script.Parent.Zombies
        end
    elseif round==2 then

    end
end)

Anyone know a solution?

1 answer

Log in to vote
2
Answered by 8 years ago

You need to make the Zombie's joints when it is moved into Workspace.

local zombies=game.Lighting.Folder1
script.Parent.Round.Changed:connect(function(round)
    if round==1 then
        for i = 1, 10 do
            local enemy=zombies.Zombie:Clone()
            wait(1)
            enemy.Parent=script.Parent.Zombies
            enemy:MakeJoints() -- Make the joints so it doesn't fall apart.
        end
    elseif round==2 then

    end
end)
0
Thanks! This solves it! Volodymyr2004 293 — 8y
Ad

Answer this question