Zombie spawner only spawning at one place. Why?

Instead of having that script in every grave, you should have all the graves in a folder called “Graves”, and every grave is a number that goes 1, 2, 3 and so on. Put in a script in the folder that has the code:
local Graves = script:GetChildren()
local Zombie = game.ReplicatedStorage[“Normal Zombie”]
while true do
local GraveChosen = math.Random(1,#Graves)
for i, v in pairs(Graves) do
if v.Name == GraveChosen.Value then
local Clone = Zombie:Clone()
Zombie.UpperTorso.CFrame = v.CFrame
end
end
wait(5)
end

Tell Me if it helps!:slightly_smiling_face: :

1 Like

I did count them in the script though.

Also, I name my spawners Zombie spawners, and not graves. But it sounds like it would be a cooler name!

1 Like

Wait sorry, I still cannot understand the structure of the folders, Can you show me a photo?
Because i have an error called
[Workspace.Graves.Script:4: attempt to call a nil value]

Sorry, I wrote it wrong, change the first line to
local Graves = script.Parent:GetChildren()

Ok! But I tried, still have an error
[Workspace.Folder.Script:4: attempt to call a nil value]
Line four…