i have a animation that starts when K is pressed the problem is that every time i press the key the animation starts but i want it to play until is finished and when it is finished be able to play it again
local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local humanoid = player.Character.Humanoid
local mouse = player:GetMouse()
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset/?id=6968729568"
mouse.KeyDown:connect(function(key)
if key == "z" then
local playAnim = humanoid:LoadAnimation(anim)
playAnim:Play()
end
end)