Releasing the keys stops the animation but if I hold the keys for a while the animation continues?
the title explains it all.
if you hold the keys for a while after releasing the keys the animation loops itself even after the keys aren't being held anymore.
Script:
01 | local Player = game.Players.LocalPlayer |
02 | local Character = Player.Character |
03 | local UIS = game:GetService 'UserInputService' |
04 | local keyCodeQ = Enum.KeyCode.Q |
05 | local keyCode_E = Enum.KeyCode.E |
07 | UIS.InputBegan:Connect( function (input, chatting) |
12 | if UIS:IsKeyDown(keyCodeQ) and UIS:IsKeyDown(keyCode_E) then |
13 | local Anim = Instance.new( 'Animation' ) |
15 | PlayAnim = Character.Humanoid:LoadAnimation(Anim) |
20 | UIS.InputEnded:Connect( function (input, chatting) |
25 | if not UIS:IsKeyDown(keyCodeQ) and not UIS:IsKeyDown(keyCode_E) then |