local q=script.Parent.Parent script.Parent.Parent=q.Parent script.Parent.ClickDetector.MouseClick:Connect(function(X)local M=X.Character local C=M:FindFirstChild("\072\117\109\097\110\111\105\100")if C~=nil then q.Parent=M script.Parent.Parent=q q.AncestryChanged:Connect(function(X)local C=X.Parent if C.Name~="\066\097\099\107\112\097\099\107"and(C~=M and script.Parent.Parent==q)then script.Parent.Parent=q.Parent end end)end end)

local tool = script.Parent.Parent --This indicates the tool for the handle.
script.Parent.Parent = tool.Parent --This removes the "Touch to Equip" function for the handle.
script.Parent.ClickDetector.MouseClick:Connect(function(plr) --This detects a click on the handle.
	local character = plr.Character --This identifies the player's character.
	local humanoid = character:FindFirstChild("Humanoid") --This identifies "Humanoid".
	if humanoid ~= nil then --This ensures that "Humanoid" exists inside the player's character.
		tool.Parent = character --This causes the character to equip the tool.
		script.Parent.Parent = tool --This puts the handle inside the tool.
		tool.AncestryChanged:Connect(function(item) --This detects a change in the tool's ancestry.
			local parent = item.Parent --This identifies the parent of the tool.
			if parent.Name ~= "Backpack" and parent ~= character and script.Parent.Parent == tool then
				--The code above ensures the parent isn't the player's backpack or character, and the handle is inside the tool.
				script.Parent.Parent = tool.Parent --This ensures that "Touch to Equip" is disabled.
			end
		end)
	end
end)
