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
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