How could a script detect if a tool touches the holder's own head or someone else's head?

The title is basically all I’m asking but the reason why I’m asking it is because it won’t detect the holder’s head either, only other player’s/npc’s heads.

Tool.Touched:Connect(function(hit)
if hit.Parent == char.Head then -- or other player
print("head")
end)

pulled this one up in 60 seconds
you’ll probably need to check if it hit a humanoid first, idk

There’s no Tool.Touched event, you’d have to use the Tool Handle instead, also hit.Parent would be the characrer, so you’d check if the character was the head, which wouldn’t work.

local Tool = script.Parent
local Handle = Tool.Handle

Handle.Touched:Connect(function(hit))
 local h = hit.Parent:FindFirstChildOfClass("Humanoid")

 if h then
    if hit.Name == "Head" and hit:IsA("BasePart") then
     print("Head Hit")
    end
  end
end)
1 Like

well you could certainly say i was close enough

it’s the thought that counts right??

1 Like