local val = game.ReplicatedStorage.numberval.Value
for i = 1,10 do
game.ReplicatedStorage.bacteria:Clone()
game.ReplicatedStorage.bacteria:Clone().Parent = workspace
game.ReplicatedStorage.bacteria:Clone().HumanoidRootPart.Position = Vector3.new(math.random(-315.026, -268.827),-148.634, 2.76)
print("spawned 1wave")
wait()
end
while true do
if val == 10 then
for i = 1,10 do
game.ReplicatedStorage.bacteria:Clone()
game.ReplicatedStorage.bacteria:Clone().Parent = workspace
game.ReplicatedStorage.bacteria:Clone().HumanoidRootPart.Position = Vector3.new(math.random(-315.026, -268.827),-148.634, 2.76)
print("spawned 2wave")
wait()
val = val + 1
end
elseif val == 30 then
for i = 1,10 do
game.ReplicatedStorage.bacteria:Clone()
game.ReplicatedStorage.bacteria:Clone().Parent = workspace
game.ReplicatedStorage.bacteria:Clone().HumanoidRootPart.Position = Vector3.new(math.random(-315.026, -268.827),-148.634, 2.76)
print("spawned 3wave")
wait()
end
elseif val == 40 then
for i = 1,10 do
game.ReplicatedStorage.bacteria:Clone()
game.ReplicatedStorage.bacteria:Clone().Parent = workspace
game.ReplicatedStorage.bacteria:Clone().HumanoidRootPart.Position = Vector3.new(math.random(-315.026, -268.827),-148.634, 2.76)
print("spawned 4wave")
wait()
end
elseif val == 50 then
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "bacteria" and v.Humanoid then
v:remove()
print("removed waste.....")
end
end
end
wait(0.1)
end
Does not print anything but print("spawned wave1") Im trying to make "zombie" waves. Im not sure what the error is. No errors are shown in output And whenever a zombie is killed it adds 1 to the value, Ive checked the value succesfully changes to 10 after all the zombies are killed. So i dont know what to do

1 comment
Well you never changed the numberVal make sure to add 10 to the numberVal everyround