local G=game:GetService("\074\111\105\110\116\115\083\101\114\118\105\099\101")local R=workspace:PGSIsEnabled()function MakeWeld(R,d,q,E)if q==nil then q="\087\101\108\100"end local A=Instance.new(q,G)A.Part0=R A.Part1=d A.C0=R.CFrame:inverse()*R.CFrame A.C1=d.CFrame:inverse()*R.CFrame if q=="\077\111\116\111\114"and E~=nil then A.MaxVelocity=E end return A end function ModelWeld(G,R)if G:IsA("\066\097\115\101\080\097\114\116")then MakeWeld(R,G,"\087\101\108\100")elseif G:IsA("\077\111\100\101\108")then for G,d in pairs(G:GetChildren())do ModelWeld(d,R)end end end function UnAnchor(G)if G:IsA("\066\097\115\101\080\097\114\116")then G.Anchored=false G.Archivable=false G.Locked=false end for G,R in pairs(G:GetChildren())do UnAnchor(R)end end
--[[Weld functions]]

local JS = game:GetService("JointsService")
local PGS_ON = workspace:PGSIsEnabled()

function MakeWeld(x, y, type, s)
	if type == nil then
		type = "Weld"
	end
	local W = Instance.new(type, JS)
	W.Part0 = x
	W.Part1 = y
	W.C0 = x.CFrame:inverse() * x.CFrame
	W.C1 = y.CFrame:inverse() * x.CFrame
	if type == "Motor" and s ~= nil then
		W.MaxVelocity = s
	end
	return W
end

function ModelWeld(a, b)
	if a:IsA("BasePart") then
		MakeWeld(b, a, "Weld")
	elseif a:IsA("Model") then
		for i, v in pairs(a:GetChildren()) do
			ModelWeld(v, b)
		end
	end
end

function UnAnchor(a)
	if a:IsA("BasePart") then
		a.Anchored = false
		a.Archivable = false
		a.Locked = false
	end
	for i, v in pairs(a:GetChildren()) do
		UnAnchor(v)
	end
end
