TouchEnded error when equipping a tool

well, I have a problem regarding the TouchEnded and it is that when equipping or unequipping a tool by playing a part, the TouchEnded detects it as if it had stopped playing when it was not and I really don’t know what the problem is. in more depth, because basically the script works when the owner of the part stops playing the part and thus stops being the owner, but when you equip / unequip a tool, it detects it as if you stopped playing it, please help.

local Enabled = false
local Owner = script.Parent.Parent:FindFirstChild("Owner")

local function Finish(Hit)
	Enabled = true
	local character = Hit:FindFirstAncestorOfClass("Model")
	local Player = Players:GetPlayerFromCharacter(character)
	wait()
	if character then
		local SistemTreeFolder = character:FindFirstChild("SistemaDeTala")

		SistemTreeFolder:FindFirstChild("TalarArbolAnim").Value = false
		if Owner.Value == character.Name then
			Owner.Value = "N/A"
			print("desactivado")
		end
	end
end

script.Parent.TouchEnded:Connect(Finish)