local ReplicatedStorage = game:GetService("ReplicatedStorage")
local pingas = game.Workspace:WaitForChild("Pingas")
local juan = ReplicatedStorage:WaitForChild("Drooling Zombie")
local spawns = {pingas.P1, pingas.P2, pingas.P3, pingas.P4, pingas.P5, pingas.P6, pingas.P7, pingas.P8}
local cap = 5
local CF = 0
while true do
local rng = math.random(1, #spawns)
local pawn = spawns[rng]
print(pawn)
local hwan = juan:Clone()
CF += 1
if CF <= cap then
hwan.Parent = game.Workspace.Pingas.zomboss
hwan.PrimaryPart = hwan.Torso
if hwan.PrimaryPart then
hwan:SetPrimaryPartCFrame(pawn.CFrame)
else
warn("Juan model does not have a PrimaryPart set.")
end
task.wait(1)
else
warn("Max")
break
end
end```
#how can I make spawn cap not break script
11 messages · Page 1 of 1 (latest)
`lualocal ReplicatedStorage = game:GetService("ReplicatedStorage")
local pingas = game.Workspace:WaitForChild("Pingas")
local juan = ReplicatedStorage:WaitForChild("Drooling Zombie")
local spawns = {pingas.P1, pingas.P2, pingas.P3, pingas.P4, pingas.P5, pingas.P6, pingas.P7, pingas.P8}
local cap = 5
local CF = 0
while true do
local rng = math.random(1, #spawns)
local pawn = spawns[rng]
print(pawn)
local hwan = juan:Clone()
CF += 1
if CF <= cap then
hwan.Parent = game.Workspace.Pingas.zomboss
hwan.PrimaryPart = hwan.Torso
if hwan.PrimaryPart then
hwan:SetPrimaryPartCFrame(pawn.CFrame)
else
warn("Juan model does not have a PrimaryPart set.")
end
task.wait(1)
else
warn("Max")
break
end
end
did you change it?
I want it to not break permanently
What's error