--Sure you can edit both the script and the comment but the latter would be mean, no?


PartFound = nil

function Weld(x,y)
	local W = Instance.new("Weld")
	W.Part0 = x
	W.Part1 = y
	local CJ = CFrame.new(x.Position)
	local C0 = x.CFrame:inverse()*CJ
	local C1 = y.CFrame:inverse()*CJ
	W.C0 = C0
	W.C1 = C1
	W.Parent = x
end

function Get(A) --Get all parts
	if A.className == "Part" then
		if script.Parent:FindFirstChild("Handle") ~= nil then
			Weld(script.Parent.Handle, A) --You're a tool
		else
			Weld(PartFound, A) --Not a tool
		end
		A.Anchored = false
	else
		local C = A:GetChildren()
		for i=1, #C do
		Get(C[i])
		end
	end
end

function Finale()
	if(script.Parent:FindFirstChild("Handle")) ~= nil then -- A tool
		Get(script.Parent)
	else 																	-- Something else~!
		List = script.Parent:GetChildren()
		for i = 1, #List do
			if List[i].ClassName == "Part" then --Find First Part
				PartFound = List[i]
				break
			end
		end
		Get(PartFound.Parent)
	end
end

if script.Parent.ClassName == "Tool" then
	Finale() --In case the tool is sitting in the workspace
	script.Parent.Equipped:connect(Finale) --When you equip it
	script.Parent.Unequipped:connect(Finale) --And when you unequip it
else
	Finale() --But I'm not a tool!
end 
