Welding multiple parts

I’m trying to make a tool on hip / back script with multiple parts while this only works with one part that’s named handle. I’ve got it to work when unequipping but when I equip the tool again It breaks. I’m pretty sure the issue with the code is in function onEquipped

handle = nil

function onUnequipped()
	if script.Parent.Parent == workspace or script.Parent.Parent.className ~= "Backpack" then
		return
	end

	local char = script.Parent.Parent.Parent.Character
	if char ~= nil then
		local torso = char:findFirstChild("Torso")
		local tool = char:findFirstChild(script.Parent.Name)
		if torso ~= nil and tool == nil then
			local model = Instance.new("Model")
			model.Name = script.Parent.Name
			model.Parent = char

			handle = script.Parent
			for i, v in pairs(handle:GetChildren()) do
				if v:IsA("Part") then
				v.CanCollide = false
				v.Name = script.Parent.Name
				v.Parent = model

			local weld = Instance.new("Weld")
			weld.Name = "BackWeld"
			weld.Part0 = torso
			weld.Part1 = v
			weld.C0 = CFrame.new(0,0,0.6)
			weld.C0 = weld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(90),math.rad(330),0)
			weld.Parent = v
				end
			end
		end
	end
end

script.Parent.Unequipped:connect(onUnequipped)

function onEquipped()
	if handle ~= nil then 
		handle.Parent:remove()
	end
end

script.Parent.Equipped:connect(onEquipped)```

There’s two ways you could weld stuff.

1:
Create a WeldConstraint, set Part0 to the Handle and then Part1 to what you want to weld to said Handle and repeat that for each part that you want to weld. The part you are welding to the handle has to be unanchored.

2:
Use qPerfectionWeld from the toolbox which automatically welds everything together for you. Put the script into your model which has all the parts in it and done.

Are you using an R15 or R6 character? R15 doesn’t have a “Torso”.

Also why are you welding all the Parts individually to the players back? If you Weld all the Parts to the Handle in the weapon Model that you built you only have to use 1 Weld to attach the Handle to the player’s back.

function onEquipped()
	if handle ~= nil then 
		handle.Parent:remove()
	end
end

This destroys the tool. Also, this script is clearly quite old, I presume this is a free model you found.