KBM-Quine

anotherPowerDownLib

Feb 6th, 2021 (edited)
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.94 KB | None | 0 0
  1. local anotherPowerDownLib = {}
  2.  
  3. anotherPowerDownLib.enabled = true
  4.  
  5. function anotherPowerDownLib.onInitAPI()
  6.     registerEvent(anotherPowerDownLib, "onDraw", "onDraw", true)
  7. end
  8.  
  9. local playerData = {}
  10.  
  11. function anotherPowerDownLib.onDraw()
  12.     if not isOverworld and anotherPowerDownLib.enabled then
  13.         for _, p in ipairs(Player.get()) do
  14.             playerData[p] = playerData[p] or {}
  15.             playerData[p].curState = playerData[p].curState or 0
  16.             playerData[p].stateTimer = playerData[p].stateTimer or 0
  17.            
  18.  
  19.             if p.ForcedAnimationTimer == 0 then
  20.                 playerData[p].curState = p.CurrentPowerup
  21.             end
  22.             if p.ForcedAnimationState == 2 then
  23.                 if playerData[p].curState == 2 then return end
  24.                 if not anotherPowerDownLib.enabled then return end
  25.                 p.ForcedAnimationState = 227
  26.                 p.ForcedAnimationTimer = 1
  27.             end
  28.             if p.ForcedAnimationState == 227 and anotherPowerDownLib.enabled then
  29.                 p.ForcedAnimationTimer = 1
  30.                 playerData[p].stateTimer = playerData[p].stateTimer + 1
  31.                 if playerData[p].stateTimer % 5 == 0 then
  32.                     if p.CurrentPowerup == 2 then
  33.                         p.CurrentPowerup = playerData[p].curState
  34.                     else
  35.                         p.CurrentPowerup = 2
  36.                     end
  37.                 end
  38.                 if playerData[p].stateTimer >= 50 then
  39.                     if p.CurrentPowerup == playerData[p].curState then
  40.                         p.CurrentPowerup = 2
  41.                     end
  42.                     p.BlinkTimer = 150
  43.                     p.BlinkState = true
  44.                     p.ForcedAnimationState = 0
  45.                     p.ForcedAnimationTimer = 0
  46.                     playerData[p].stateTimer = 0
  47.                 end
  48.             end
  49.         end
  50.     end
  51. end
  52.  
  53. return anotherPowerDownLib
Add Comment
Please, Sign In to add comment