Does anybody know how to make a hitbox appear on the arm of the player when the punch animation plays? I have this right now and I want to use a hitbox
local punchAnimation = player.Character.Humanoid.Animator:LoadAnimation(script.BrawlerRightPunch)
punchAnimation:Play()
punchAnimation.KeyframeReached:Connect(function(keyframeName)
if keyframeName ~= "Damage" then
return
end
local rightTouched = player.Character.RightLowerArm.Touched:connect(function(hit)
if hit.Name == "Hitbox" and punchCount.Value == 0 then
print("L")
punchCount.Value = 1
hit.Parent.Humanoid.Health -= 5
end
end)
local leftTouched = player.Character.RightUpperArm.Touched:connect(function(hit)
if hit.Name == "Hitbox" and punchCount.Value == 0 then
print("U")
punchCount.Value = 1
hit.Parent.Humanoid.Health -= 5
end
end)
task.wait(0.2)
rightTouched:Disconnect()
leftTouched:Disconnect()