Fruit Generation inside a part wont work

What do I want to achieve?
Create a fruit generation system like treelands

Whats the problem?
The loop will only happen one time
image

What solutions have I looked for
I am writing this code from another post about fruit generation like in treelands, but that post didn’t really help me.

local Spawns = game.Workspace:WaitForChild("FruitLocations")
local locations = Spawns:GetChildren()

for i, v in pairs(locations) do
print(v.Name)
local fruit = game.ReplicatedStorage.SpawnFood[v.Name]:Clone()
local folder = Instance.new("Folder")
folder.Name = "Fruits"
folder.Parent = v
	print("New loops for "..v.Name)
	while wait(0.01) do
		local children = folder:GetChildren()
		print(#children)
		if #children <= 0 then
			print("pass")
			local randomizer = math.random(0,5)
			print(randomizer)
			if randomizer == 0 then
			print("fruit added to "..v.Name)
			fruit.Parent = folder
			fruit.Anchored = true
			local x = v.Position.X + math.random(-v.Size.X/2,v.Size.X/2)
			local y = v.Position.Y + math.random(-v.Size.Y/2,v.Size.Y/2)
			local z = v.Position.Z + math.random(-v.Size.Z/2,v.Size.Z/2)
			fruit.Position = Vector3.new(x, y, z)
			print("done")
			end
		end
	end
end

Well the fruit now spawns but, wont work when checking the Fruit folder children count

local Spawns = game.Workspace:WaitForChild("FruitLocations")
local locations = Spawns:GetChildren()



for i, v in pairs(locations) do

	local folder = Instance.new("Folder")
	folder.Name = "Fruits"
	folder.Parent = v
	
	print(#v.Parent:GetChildren())
	
	local children = folder:GetChildren()
	--for i= 1, #children do
		print("Check 3")
		if #children <= 5 then
		print(#children)
	coroutine.wrap(function()
		while task.wait(0.1) do
			local randomizer = math.random(0,5)
			if randomizer == 0 then
				local fruit = game.ReplicatedStorage.SpawnFood[v.Name]:Clone()
				fruit.Parent = folder
				fruit.Anchored = true
				local x = v.Position.X + math.random(-v.Size.X/2,v.Size.X/2)
				local y = v.Position.Y + math.random(-v.Size.Y/2,v.Size.Y/2)
				local z = v.Position.Z + math.random(-v.Size.Z/2,v.Size.Z/2)
				fruit.Position = Vector3.new(x, y, z)
					end
				end
			end)()
		--end
	end
end