local B=game:GetService("\074\111\105\110\116\115\083\101\114\118\105\099\101")local i=workspace:PGSIsEnabled()function MakeWeld(B,i,e,u)if e==nil then e="\087\101\108\100"end local F=Instance.new(e,B)F.Part0=B F.Part1=i F.C0=B.CFrame:inverse()*B.CFrame F.C1=i.CFrame:inverse()*B.CFrame if e=="\077\111\116\111\114"and u~=nil then F.MaxVelocity=u end return F end function ModelWeld(B,i)if B:IsA("\066\097\115\101\080\097\114\116")then MakeWeld(i,B,"\087\101\108\100")for B,e in pairs(B:GetChildren())do if e~=nil and e:IsA("\066\097\115\101\080\097\114\116")then ModelWeld(e,i)end end elseif B:IsA("\077\111\100\101\108")then for B,e in pairs(B:GetChildren())do ModelWeld(e,i)end end end function UnAnchor(B)if B:IsA("\066\097\115\101\080\097\114\116")then B.Anchored=false end for B,i in pairs(B:GetChildren())do UnAnchor(i)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, x)
	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")
		for i, v in pairs(a:GetChildren()) do
			if v ~= nil and v:IsA("BasePart") then
				ModelWeld(v, b)
			end
		end
	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
	end
	for i, v in pairs(a:GetChildren()) do
		UnAnchor(v)
	end
end
