Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What do I do after the zombies reached the limit?

After the limit it stopped respawning Please help

zombie = script.Parent.Parent["Normal Zombie"]
zombiebackup = zombie:Clone() 
zombie:Destroy() --use Destroy instead of remove

local limit = 3 --change to edit limit

for i = 1,limit do
wait(5) 
local newzombie = zombiebackup:Clone() 
newzombie.Parent = game.Workspace 
newzombie:MakeJoints()
newzombie.Torso.CFrame = script.Parent.CFrame + Vector3.new(0, 5, 0) 
newzombie:MakeJoints()
zombie = newzombie 
zombiebackup = zombie:Clone() 
end 


2 comments

0

I killed 3 of the zombies and it stopped respawning

0

Your script runs through a loop 3 times, your set "limit, waiting 5 seconds between spawning each zombie. What else do you want it to do?

1 answer

Obviously it stopped! You made the script so that they stop respawning after 3 zombies! Your script is working perfectly! Anyway, if you want the zombies to continously respawn with no limit, I modified the script:

zombie = script.Parent.Parent["Normal Zombie"]
zombiebackup = zombie:Clone() 
zombie:Destroy() --use Destroy instead of remove

--I deleted the limit so that a zombie continously spawns every 5 seconds.

while true do
wait(5) -- You can change the 5 to any number you want. Every 5 seconds a zombie will spawn.
local newzombie = zombiebackup:Clone() 
newzombie.Parent = game.Workspace 
newzombie:MakeJoints()
newzombie.Torso.CFrame = script.Parent.CFrame + Vector3.new(0, 5, 0) 
newzombie:MakeJoints()
zombie = newzombie 
zombiebackup = zombie:Clone() 
end 



6 comments

0

If you want a different thing to happen after the limit, please explain better what do you want to do!

0

If you want a different thing to happen after the limit, please explain better what do you want to do!

0

I want the limit still there,basically just like 3 zombies in 1 map till some players killed 1 zombie then another zombie will spawn in,just the limit is 3 zombie

0

Ok, then I think you're asking for too much. Scripting helpers is NOT a request site. I mean, Scripting helpers is not for asking others to script for you. It's against the rules. If you want to make a zombie game, learn to code. Sorry, but I'm not helping with making an entire code.

0

I'm explaining not "requesting" lmao

This discussion is preserved as it was. New answers, comments, and votes are closed.