Part not cloning into all parts in a table

Im trying to clone a part into several Position parts in the workspace.

All that doesnt work is that it’s only cloning the part into the first Position part it finds.

RingsPosition = game.Workspace.RingPositions:GetChildren()
Ring = game.Lighting.Ring:Clone()

for i,v in ipairs(RingsPosition) do
	
	RingsPosition[i].Parent = game.Lighting	
	
	Ring.Parent = game.Workspace
	Ring.Position = RingsPosition[i].Position
	
	print("Worked", RingsPosition[i].Position)
	
end

Try moving the Ring = game.Lighting.Ring:Clone() inside the i, v in pairs, unless you only want 1 ring

1 Like

You have only cloned it once.

And you also do not have to do RingsPosition[i]
Cause the 2nd variable in the for loop (i am talking about v) is a shortcut to RingsPosition[i]. i stands for the index in the table and v is the actual value

for i,v in ipairs(RingsPosition) do
	local Ring = game.Lighting.Ring:Clone()
	v.Parent = game.Lighting	
	
	Ring.Parent = game.Workspace
	Ring.Position = v.Position
	
	print("Worked", v.Position)
	
end
1 Like

Thanks. I used both ideas and its fixed now.

I put
RingClone = Ring:Clone()
into the loop which fixed it