How to move a model to a parts location

i tried diffrent ways for the cloned model to move -100 parts on X but none work for i = 1, 10 do

for i = 1, 10 do
	local r = maps[math.random(1, #maps)]
	
	r:Clone()
	r:Clone().Parent = workspace.currentMaps
	r:Clone():PivotTo(workspace.MoveToPart.CFrame)
	workspace.MoveToPart.CFrame += Vector3.new(-100, 0, 0)
end

the cloning works but i dont know how to move the model -100 parts on X

You can use Model:PivotTo(CFrame) for that.

r:Clone():PivotTo(workspace.MoveToPart.CFrame - Vector3.xAxis*100)
2 Likes

This should do it

local clone = r:Clone() :: Model -- this is a model
clone:PivotTo(CFrame.new(-100, 0, 0))
clone:PivotTo(CFrame.new(-100, 0, 0) * clone:GetPivot().Rotation) -- keep rotation

If you’re using :PivotTo() or :MoveTo(), make sure your model has a PrimaryPart set as well.

i put one it still doesnt work