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

Zombie Death spawn and de-spawn?

Asked by 8 years ago

I have created a zombie spawn which spawns a model of the zombie every 5 seconds. However the zombies are breaking up into little Pieces with no Health. The first thing I wanted to tackle was getting them to de-spawn here is what I have for them to do so:

local zombie = script.Parent

if zombie.Humanoid.Health <1 then
    zombie:remove()
end

But they are still not de-spawning.

The second thing is that how do I get the zombie to stay together with full health. here is what I have for the spawning:


while true do function SpawnZombie() local g = game.ServerStorage.Zombie:Clone(1) g.Parent = game.Workspace g.Humanoid:MoveTo(game.Workspace.ZombieSpawner.Position) --Also assuming that the Humanoid is called Humanoid. end wait(5) SpawnZombie(1) end

Please help?

2 answers

Log in to vote
0
Answered by 8 years ago
while true do

function SpawnZombie()

    local g = game.ServerStorage.Zombie:Clone(1)

    g.Parent = game.Workspace
    g:MakeJoints()--Goes through the Zombie Model and checks if any Part the has a SurfaceType to create joints if it does then it creates the joint.
    g.Humanoid:MoveTo(game.Workspace.ZombieSpawner.Position) --Also assuming that the Humanoid is called Humanoid.

end

wait(5)

SpawnZombie(1)

end
Ad
Log in to vote
0
Answered by
Kurieita 125
8 years ago

Most likely the cause of this is there are no joints. Try adding motor6d joints to the head, torso, arms, and legs.

Upvote if this work for you :)

Answer this question