I'm trying to make a loop that creates parts and stops when there's 20 parts, but then continues again when there is less than 20 parts in the game.
while wait(.1) do
local model = game.Workspace.Model
local children = model:GetChildren()
local part = Instance.new("Part")
part.Parent = workspace.Model
part.Position = Vector3.new(10,10,10)
print(#children)
if #children >= 20 then
end
end

1 comment
Thank you