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
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]