Hello. I made a combat system and when i hit people it works. But, when i hit someones acessory, it stops working and says there is no humanoid in the players acessory. If i make the script to hit the parents parent, then it wont work unless i hit the acessory. If i dont, i still cant hit the players with acessories. Can someone help?

local canPunch = true
script.Parent.Handle.Touched:Connect(function(hit)
	if canPunch == true then
		canPunch = false
		local hum = hit.Parent.Humanoid
		if hum.Parent ~= script.Parent.Parent then
			hum:TakeDamage(10)
			wait(1)
				canPunch = true
			end
		end
end)