while true do()
StarterMax = 10
sc = 0
function StarterLoop()
if sc <= StarterMax then
StarterPatchGrow()
sc = sc + 1
print(sc)
end
end
wait(1)
end
function StarterPatchGrow() -- Starter Patch Generation
math.randomseed(tick())
local _x = UnnamedModels:GetChildren()
local x = _x[math.random(1,#_x-2)]
local _y=x:GetChildren()
local y = _y[math.random(1,#_y)]
local Value = GetValue(y,"Unnamed")
local RealModel = y:Clone()
RealModel.Parent = StarterPatch.SpawnedPumpkins
RealModel.Position = Vector3.new(math.random(StarterPatch.MinX.Value,StarterPatch.MaxX.Value),math.random(StarterPatch.MinY.Value,StarterPatch.MaxY.Value),math.random(StarterPatch.MinZ.Value,StarterPatch.MaxZ.Value))
local PumpkinLabel = game.ReplicatedStorage.LoadModels.UI.PumpkinLabel:Clone()
PumpkinLabel.Adornee=RealModel
PumpkinLabel.Parent=RealModel
PumpkinLabel.Frame.Nickname.Text = 'Name : '..RealModel.Name
PumpkinLabel.Frame.Rarity.Text = 'Rarity : '..x.Name
PumpkinLabel.Frame.PumpkinValue.Text = 'Value : '..Value
end
The loop will continue to print 1, anyone know why?

8 comments
I'm not good at scripting so I'll just ask; why += and not just = ?
You need to include "sc" in the assignment. Don't use a compound assignment so "sc = sc + 1"
Even when I only include sc = sc + 1, it prints 1 every time still.
Is StarterMax a variable? Because you never use it
What's the rest of the code? Your function doesn't have a loop.
Does it print 1 only one time or does it repeat it?
You're resetting sc=0 at the top of the loop everytime. Put the "sc = 0" outside of the while loop.
Ahhhhhhhhhhhhhhhhhhhhhh thanks