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?
