I'm trying to make a crawl animation play when you click "E" but i want it to loop until i release "E"... How?
Code:
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=1267282598"
mouse.KeyDown:connect(function(key) if key == "e" then local playAnim = humanoid:LoadAnimation(anim) playAnim:Play() end end)
The animation is 0.1 seconds long so do i just have to make it like 100 sec long and it will automatically loop until i no longer press it?

1 comment
You could create a loop when e is pressed.