punch = false
damage = true
plr = game.Players.LocalPlayer
while not plr.Character do
wait()
end
plr:GetMouse().KeyDown:Connect(function(k)
ctr = plr.Character
hum = ctr:WaitForChild("Humanoid")
LeftArm = ctr:WaitForChild("Left Arm")
ctr = plr.Character
PunchAnim = Instance.new("Animation")
PunchAnim.AnimationId = "https://web.roblox.com/asset/?id=".."2523553984"--put id here
PunchAnimTrack = hum:LoadAnimation(PunchAnim)
Power = game.Players.LocalPlayer.PlayerGui.MenuGui.StatsFolder.StrengthValue.Value
Strength = game.Players.LocalPlayer.PlayerGui.MenuGui.StatsFolder.Strength
if k == "e" then
if punch == false then
punch = true
damage = false
PunchAnimTrack:Play()
wait(0.5)
punch = false
damage = true
end
end
end)
while punch do
LeftArm.Touched:Connect(function(hit)
if damage == false then
damage = true
human = hit.Parent:WaitForChild("Humanoid")
human:TakeDamage(Power)
wait(0.5)
damage = false
end
end)
end
This is the script I used. Yes, I have tried printing and I don't seem to find the issue. No errors in output. The punching animation does work. If you know the answer to this, then tell me as soon as possible.

6 comments
Is this in a localscript?
yep
its in starterpack
Don't use KeyDown, it is deprecated. Use UserInputService instead.
If you want it to damage the player, you can just subtract from the player's health (found in the humanoid)
KeyDown is not a valid event of the player's Mouse because mice don't have keys