How can I get this script to never stop cloning the parts?

I am hoping to achieve to make this script to never stop cloning the parts!

There’s no error in the output,

I searched on the Developer Hub and couldn’t find anything. I’ve tried to put the number in the code to -1 but it wouldn’t clone anything.

Here’s the code I have.

local count = 99

wait(1)


for i = 1, count, 1 do

	local clonedObby = game.Workspace:FindFirstChild("Obby"..i):Clone()
	clonedObby.Parent = workspace
	clonedObby.Name = "Obby"..i + 1

	for i,v in pairs(clonedObby:GetChildren()) do
		if v:IsA("Part") then
			v.Position = v.Position - Vector3.new(450,0,0)
		elseif v.Name == "Truss" then
			v.Position = v.Position - Vector3.new(450,0,0)		
		end
	end
	wait(0.1)
end

You want to make a loop ? I didn’t really quite understand.

It’s like an infinite realm area where it won’t stop generating the part you walk on.

I don’t know what you want to achieve, but one of the ways to solve this problem is the while true loop

while true do
--Some code
end

don’t forget to add wait()

2 Likes