--http://robloxdev.com/code-sample/Weld-Code-Sample-1

local function Weld(part0, part1, parent)
	local weld = Instance.new("WeldConstraint")
	weld.Part0 = part0
	weld.Part1 = part1
	weld.Parent = parent or part0
	
	return weld
end

local function WeldParts(parts, main, unanchor)
	for i,v in pairs(parts) do
		Weld(main, v)
	end
	
	if not unanchor then
		for i = 1, #parts do
			parts[i].Anchored = false
		end
		main.Anchored = false
	end
end

