local function Q(Q,x)local n=CFrame.new(Q.Position)local Z=Q.CFrame:inverse()*n local N=x.CFrame:inverse()*n local g=(Create("\087\101\108\100"))({Name="\087\101\108\100",Parent=Q,Part0=Q,Part1=x,C0=Z,C1=N})end local function x(x)for x,n in pairs(x:GetChildren())do if n:IsA("\080\097\114\116")or n:IsA("\085\110\105\111\110\079\112\101\114\097\116\105\111\110")then Q(Handle,n)n.Anchored=false end end end Tool.Equipped:connect(function()x(Tool)end)Tool.Unequipped:connect(function()x(Tool)end)


local function Weld(X, Y)
	local CJ = CFrame.new(X.Position)
	local C0 = X.CFrame:inverse()*CJ
	local C1 = Y.CFrame:inverse()*CJ
	
	local W = Create("Weld"){
		Name = "Weld",
		Parent = X,
		Part0 = X,
		Part1 = Y,
		C0 = C0,
		C1 = C1
	}
end

local function WeldObjects(parent)
	for i, obj in pairs(parent:GetChildren()) do
		if obj:IsA("Part") or obj:IsA("UnionOperation") then
			Weld(Handle, obj)
			obj.Anchored = false
			-- print("[Weld] Objects have been welded!")
		end
	end
end

Tool.Equipped:connect(function()
	WeldObjects(Tool)
end)

Tool.Unequipped:connect(function()
	WeldObjects(Tool)
end)
