function WeldPair(x,k)local i=Instance.new("\077\111\116\111\114\054\068",x)i.Part0=x i.Part1=k i.C1=k.CFrame:toObjectSpace(x.CFrame)end function WeldAll(x,k)if x:IsA("\066\097\115\101\080\097\114\116")then WeldPair(k,x)end for x,i in pairs(x:GetChildren())do WeldAll(i,k)end end function UnanchorAll(x)if x:IsA("\066\097\115\101\080\097\114\116")then x.Anchored=false end for x,k in pairs(x:GetChildren())do UnanchorAll(k)end end WeldAll(script.Parent,script.Parent.Handle)UnanchorAll(script.Parent)script:Destroy()
-- MasterWeld by Zephyred
-- Works for all types of parts, unions etc.
function WeldPair(x, y)
	local weld = Instance.new("Motor6D", x)
	weld.Part0 = x
	weld.Part1 = y
	weld.C1 = y.CFrame:toObjectSpace(x.CFrame)
end

function WeldAll(model, main) -- model can be anything
	if model:IsA("BasePart") then
		WeldPair(main, model)
	end
	for _, v in pairs(model:GetChildren()) do
		WeldAll(v, main)
	end
end

function UnanchorAll(model) -- model can be anything
	if model:IsA("BasePart") then
		model.Anchored = false
	end
	for _, v in pairs(model:GetChildren()) do
		UnanchorAll(v)
	end
end

WeldAll(script.Parent, script.Parent.Handle)
UnanchorAll(script.Parent)

script:Destroy() -- Done, clean script up.
