So I have a script for when you press Q if plays a punching animation, does anyone know how to make it so it damages? I wanna make sure it only enables damaging once the key is pressed
what you should do is create a punching variable
local punching = false
then when you click q you make the bool true, after the animation is over set it back to false
Now you should create a touched event for the end of the arm, specifically the RightHand & LeftHand if you are using R15, if R6 just the Right Arm and Left Arm will work.
Example, I made it so that when the righthand is touched it should check that the thing that touched it is not from that character and that there is a humanoid in its parent.
local punching = false character.RightHand.Touched:connect(function(hit) if hit.Parent~=character and hit.Parent:FindFirstChild("Humanoid")~=nil and punching==true then hit.Parent.Humanoid:TakeDamage(10) end end)
This example is for the RightArm, you should have to set it up for the LeftHand as well if this was for R15 and the other way around for R6.