Guest User

[FE] Animations on keybind script

a guest
Jul 18th, 2019
3,642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.07 KB | None | 0 0
  1. -- Edit the last line.
  2.  
  3. --[[
  4.  
  5. **R6 Animations**
  6. rbxassetid://181526230 - Faint
  7. rbxassetid://313762630 - Levitate
  8. rbxassetid://188632011 - ** Spinner
  9. rbxassetid://179224234 - Float Sit
  10. rbxassetid://180612465 - Scared
  11. rbxassetid://121572214 - Floating Head
  12. rbxassetid://182724289 - Crouch
  13. rbxassetid://429703734 - Moving Dance
  14. rbxassetid://313762630 - Glitch Levitate
  15. rbxassetid://429730430 - ** Spin Dance
  16. rbxassetid://186934910 - ** Spin Dance 2
  17. rbxassetid://181525546 - Floor Faint
  18. rbxassetid://181525546 - Super Faint
  19. rbxassetid://204292303 - Bow Down
  20. rbxassetid://204295235 - Sword Slam
  21. rbxassetid://33796059  - Insane
  22. rbxassetid://184574340 - Mega Insane
  23. rbxassetid://35978879  - Sword Slice
  24. rbxassetid://35154961  - ** Head Throw
  25. rbxassetid://282574440 - Floor Crawl
  26. rbxassetid://204328711 - Dino Walk
  27. rbxassetid://35154961  - ** Loop Head
  28. rbxassetid://184574340 - Hero Jump
  29. rbxassetid://215384594 - Weird Move Back
  30. rbxassetid://215384594 - Clone Illusion
  31. rbxassetid://45834924  - Moon Dance
  32. rbxassetid://204062532 - Full Punch
  33. rbxassetid://218504594 - Full Swing
  34. rbxassetid://259438880 - Arm Turbine
  35. rbxassetid://136801964 - Barrel Roll
  36. rbxassetid://33169583  - ** Arm Detach
  37. rbxassetid://27432691  - ** Insane Arms
  38.  
  39.  
  40. **R15 Animations**
  41. rbxassetid://754658275 - Spinner
  42. rbxassetid://582855105 - Open
  43. rbxassetid://698251653 - Circle Arm
  44. rbxassetid://754656200 - Fling Arms
  45. rbxassetid://674871189 - Crazy Slash
  46. rbxassetid://717879555 - Float Slash
  47. rbxassetid://746398327 - Down Slash
  48. rbxassetid://675025570 - Rotate Slash
  49. rbxassetid://696096087 - Bend
  50. rbxassetid://582384156 - Arms out
  51. rbxassetid://708553116 - Zombie Attack
  52. rbxassetid://675025795 - Pull
  53.  
  54. ]]
  55.  
  56.  
  57.  
  58. function keyBindAnim(animID, keybind, keybindDestroy, LoopValue)
  59.  
  60. print('Added New Animation on KeyBind:', keybind)
  61. local plr = game.Players.LocalPlayer
  62. local m = plr:GetMouse()
  63. local Anim = Instance.new("Animation", game.Lighting)
  64. Anim.AnimationId = animID
  65. local track = plr.Character.Humanoid:LoadAnimation(Anim)
  66. local active = false
  67.  
  68. plr.CharacterAdded:connect(function(character)
  69.    track = character:WaitForChild('Humanoid'):LoadAnimation(Anim)
  70.    active = false
  71. end)
  72.  
  73. m.KeyDown:connect(function(key)
  74.    if key == keybind and Anim.Parent ~= nil then
  75.        active = not active
  76.        if active and LoopValue == false then
  77.            track:Play(.1, 1, 1)
  78.        elseif active and LoopValue == true then
  79.            while active do
  80.                wait(.1)
  81.                if track.IsPlaying == false then
  82.                    track:Play(.1, 1, 1)
  83.                    wait()
  84.                end
  85.            end
  86.        elseif not active and Anim.Parent ~= nil then
  87.            track:Stop()
  88.        end
  89.    elseif key == keybindDestroy and Anim.Parent ~= nil then
  90.        active = false
  91.        track:Stop()
  92.        Anim:Destroy()
  93.        print('Animation stopped on Keybind: ', keybind)
  94.    end
  95. end)
  96. end
  97.  
  98. --keyBindAnim(Animation Id, KeyBind, DestroyBind, LoopValue)
  99. --Example: keyBindAnim('rbxassetid://179224234' , 'x', 'z', true)
  100.  
  101. keyBindAnim('rbxassetid://188632011' ,'x', 'z', true)
Advertisement
Add Comment
Please, Sign In to add comment