I need a piece of code that when u spam the key (In my case e) It only plays until it finishes.
local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local humanoid = player.Character.Humanoid
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset/?id=03836741039"
mouse.KeyDown:connect(function(key)
if key == "e" then
local playAnim = humanoid:LoadAnimation(anim)
playAnim:Play()
end
end)

1 comment
you could posibly wait the amount of time the animation takes