I made a animation that punches and hurt people. The animation interrupts when I press the mouse button many times. I want it to only play again if the animation is done.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Button1Down:connect(function()
local animation = Instance.new("Animation")
animation.AnimationId="http://www.roblox.com/asset/?id=791758753"
local character = Player.Character
local anim = character.Humanoid:LoadAnimation(animation)
anim:Play()
wait(3)
character.RightHand.Touched:connect(function(hand)
local humanoid = hand.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
humanoid.Health = 0
hand.Velocity = (hand.CFrame.lookVector) * -50
end
end)
end)
Bonus Question: How do I hurt a humanoid when the animation is playing and touching the humanoid? When the humanoid touches my hand, it hurts them when i'm not playing the animation. Hope this makes sense.

3 comments
Explain line 3 please.
I believe I already did with the comment
facepalm