Advertisement
NSKuber

Untitled

Feb 28th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. --powerup : CGenericPowerUpItemEntity
  2.  
  3. local Buttons = {"Escape","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12",
  4. "Tilde","1","2","3","4","5","6","7","8","9","0","-","=","Backspace","Tab","Caps Lock",
  5. "Left Shift","Left Control","Left Alt","Right Shift","Right Control","Right Alt",
  6. "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U",
  7. "V","W","X","Y","Z","[","]",";","\'","\,",".","/","Enter","\\","Space",
  8. "Arrow Up","Arrow Down","Arrow Left","Arrow Right",
  9. "Num 0","Num 1","Num 2","Num 3","Num 4","Num 5","Num 6","Num 7",
  10. "Num 8","Num 9","Num *","Num -","Num +","Num Enter","Num .","Num /",
  11. "Page Up","Page Down","Insert","Delete","Print Screen","Scroll Lock",
  12. "Mouse Button 1","Mouse Button 3","Mouse Button 2","Mouse Wheel Up","Mouse Wheel Down",}
  13.  
  14. --PUT SHORTCUT HERE IN THE FORMAT "<BUTTON_1>|<BUTTON_2>|...|<BUTTON_N>|"
  15. --IN SAME ORDER THEY APPEAR IN THE TABLE ABOVE ^^^
  16. local hideShortcut = "Right Control|Insert|"
  17.  
  18. local previousCombo = ""
  19. local comboString = ""
  20. local pressedNum = 0
  21. local powerupsHidden = false
  22. local IsHandled = {}
  23. local PowerupPlaces = {}
  24.  
  25. local HandlePowerup = function(powerup)
  26. RunAsync(function()
  27. if (powerup ~= powerup:GetEffectiveEntity()) then return end
  28. while not IsDeleted(powerup) do
  29. PowerupPlaces[powerup] = powerup:GetPlacement()
  30. local hidePlace = mthQuatVect(mthHPBToQuaternion(0,0,0),mthVector3f(232+mthRndF()*100,3344.2,23*mthRndF()))
  31. while powerupsHidden and not IsDeleted(powerup) do
  32. powerup:SetPlacement(hidePlace)
  33. Wait(Delay(0.25))
  34. end
  35. if not IsDeleted(powerup) then
  36. powerup:SetPlacement(PowerupPlaces[powerup])
  37. powerup:SetLinearVelocity(mthVector3f(0,0,0))
  38. PowerupPlaces[powerup] = nil
  39. Wait(CustomEvent("BFEEnhancedHidePowerups"))
  40. end
  41. end
  42. end)
  43. end
  44.  
  45. while true do
  46. comboString = ""
  47. for num,button in pairs(Buttons) do
  48. if IsKeyPressed(button) then
  49. comboString = comboString..button.."|"
  50. end
  51. end
  52.  
  53. if (previousCombo ~= comboString) and (comboString == hideShortcut) then
  54. powerupsHidden = not powerupsHidden
  55. if powerupsHidden then
  56. worldInfo:ShowMessageToAll("Powerups hidden!")
  57. SignalEvent("BFEEnhancedHidePowerups")
  58. else
  59. worldInfo:ShowMessageToAll("Powerups returned!")
  60. end
  61. end
  62.  
  63. local Powerups = worldInfo:GetAllEntitiesOfClass("CGenericPowerUpItemEntity")
  64. for i=1,#Powerups,1 do
  65. if not IsHandled[Powerups[i]] then
  66. IsHandled[Powerups[i]] = true
  67. HandlePowerup(Powerups[i])
  68. end
  69. end
  70.  
  71. previousCombo = comboString
  72. Wait(CustomEvent("OnStep"))
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement