✓ Accepted answer
To pick things randomly, I usually use the math.random function which picks the number within range : `math.random(--[[Smallest Num--]],--[[Largest Num--]].
In your case, you want to pick things within your zombie folder so you would do
local folder =
local pickedZombie = math.random(1,#folder:GetChildren())
Then you would want to create a clone for that object. You can get the thing inside your folder using table[pickedZombie]. By the way, GetChildren() returns a table of children of that folder.
local cloneZombie = folder:GetChildren()[pickedZombie]:Clone()
Last, you would want to set the parent of cloneZombie to workspace and you will soon be spawning armies of random zombies!
2 comments
Don`t forget to use the wait() in while loop or the game will crash
theres no need for a wait in the while loop, since it revolves around the for loop which already has a wait.