The placeEgg function wasn’t working so I debugged it with print and found out that the for loop wasn’t running. There are no errors and print("a") works fine, can someone help me make the for loop run?
local function placeEgg(instance)
print("make")
local egg = instance:Clone()
egg.Parent = workspace
local x = math.random(-803, 292)
local z = math.random(-1042, 45)
egg.Position = Vector3.new(x, 32.02, z)
egg.CanCollide = false
egg.Anchored = true
end
while total_eggs <= 100 and wait(3) do
total_eggs += 1
local num = math.random(0,10000)
print("a")
for i,v in ipairs(eggs) do
print("for loop")
if v["Rarity"] <= num then
print("found")
placeEgg(v["Instance"])
break
end
end
end