-- 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)
