function Weld(K,L)local M=Instance.new("\087\101\108\100")M.Part0=K M.Part1=L M.C0=K.CFrame:inverse()*CFrame.new(K.Position)M.C1=L.CFrame:inverse()*CFrame.new(K.Position)M.Parent=K end function WeldIt(K)if K then if K:IsA("\066\097\115\101\080\097\114\116")then Weld(script.Parent.Handle,K)end for K,L in pairs(K:children())do WeldIt(L)end end end script.Parent.Equipped:connect(function()WeldIt(script.Parent)end)script.Parent.Unequipped:connect(function()WeldIt(script.Parent)end)WeldIt(script.Parent)
-- If gun has more than one part undisable this and it will weld everything for you!
function Weld(p0, p1)
	local weld = Instance.new("Weld")
	weld.Part0 = p0
	weld.Part1 = p1
	weld.C0 = p0.CFrame:inverse() * CFrame.new(p0.Position)
	weld.C1 = p1.CFrame:inverse() * CFrame.new(p0.Position)
	weld.Parent = p0
end

function WeldIt(obj)
	if obj then
		if obj:IsA("BasePart") then
			Weld(script.Parent.Handle, obj)
		end
		for i, v in pairs(obj:children()) do
			WeldIt(v)
		end
	end
end

script.Parent.Equipped:connect(function()
	WeldIt(script.Parent)
end)
script.Parent.Unequipped:connect(function()
	WeldIt(script.Parent)
end)
WeldIt(script.Parent)
