This while statement is doing the incorrect thing, it is giving me no errors, yet says that the children of the object are zero when that is not true. Full code:
--Don't change the name of Cannon, or anything else within the Cannon model, unless you're willing to rewrite the script.
local dispenser = script.Parent
local dispensingPosition = workspace.DoughDispenser.dispenserarea
local Holder = Instance.new("Model", game.Workspace.Containers)
Holder.Name = "DoughHolder"
--Gets the current amount of children (used later in a while statement) in the container.
local currentAmount = #workspace.Containers.DoughHolder:GetChildren()
print (currentAmount)
while game.ServerStorage.DoughValue.Value >= 1 and currentAmount <= 2 do
game.ServerStorage.DoughValue.Value = game.ServerStorage.DoughValue.Value - 1
local Copy = game.ServerStorage.DoughPart:Clone()
Copy.Parent = game.Workspace.Containers.DoughHolder
Copy.Position = dispensingPosition.Position
Copy.Velocity = Vector3.new(0,0,5)
wait(2)
end
Problematic Code:
and currentAmount <= 2 do
Help?

2 comments
Did line 8 print the correct amount of children?
No.