function onDamage(Part)
if Part.Parent:FindFirstChild("Humanoid")~= nil and Part.Parent.Name ~= "script.Parent.Name" then
Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -3.4
end
end
script.Parent.Parent.Parent.Character["Left Arm"].Touched:connect(onDamage)
--It works but I want it to only damage when I press q the problem is when I touch a humanoid My left arm damages them when I dont want them to.Help?
COMMUNITY QUESTION
Help with this punch tool?
1 answer
You are checking to see if the parent of the part's name is equal to the string, "script.Parent.Name".
e.g: is the parts name equal to Script.Parent.Name
So try this instead:
script.Parent.Parent.Parent.Character["Left Arm"].Touched:connect(function()
if Part.Parent:FindFirstChild("Humanoid")~= nil and Part.Parent.Name ~= script.Parent.Name then
Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -3.4
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
This is a less important thing, but take script.Parent.Name out of quotes. It's checking to see if the parent (of the part)'s name is equal to, literally, "script.Parent.Name", and I'm sure your character isn't named script.Parent.Name.
Answer?