This is what I tried to use, but I kept getting errors. Any idea how to fix it?

function MoveModel(Model,Pos)
	local BaseCFrame = Model.PrimaryPart.CFrame
	for i, v in pairs(Model:GetChildren()) do
		if v.ClassName == ("Part" or "Seat") and v ~= Model.PrimaryPart then
		v.CFrame = CFrame * (BaseCFrame - Pos)
		v.Anchored = true
		end
	end
	Model.PrimaryPart.CFrame = CFrame
end
MoveModel(game.Workspace.House,Vector3.new(0,50,0))

All help appreciated, thanks!

4 comments

1

If they are all in the same model, why not use the SetPrimaryPartCFrame function of model? http://wiki.roblox.com/index.php?title=API:Class/Model/SetPrimaryPartCFrame

0

Thanks, didn't know about that! :D

0

Or, you could use the MoveTo method.

0

I'll prefer the "SetPrimaryPartCFrame", since it keeps the rotation.