Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --powerup : CGenericPowerUpItemEntity
- local Buttons = {"Escape","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12",
- "Tilde","1","2","3","4","5","6","7","8","9","0","-","=","Backspace","Tab","Caps Lock",
- "Left Shift","Left Control","Left Alt","Right Shift","Right Control","Right Alt",
- "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U",
- "V","W","X","Y","Z","[","]",";","\'","\,",".","/","Enter","\\","Space",
- "Arrow Up","Arrow Down","Arrow Left","Arrow Right",
- "Num 0","Num 1","Num 2","Num 3","Num 4","Num 5","Num 6","Num 7",
- "Num 8","Num 9","Num *","Num -","Num +","Num Enter","Num .","Num /",
- "Page Up","Page Down","Insert","Delete","Print Screen","Scroll Lock",
- "Mouse Button 1","Mouse Button 3","Mouse Button 2","Mouse Wheel Up","Mouse Wheel Down",}
- --PUT SHORTCUT HERE IN THE FORMAT "<BUTTON_1>|<BUTTON_2>|...|<BUTTON_N>|"
- --IN SAME ORDER THEY APPEAR IN THE TABLE ABOVE ^^^
- local hideShortcut = "Right Control|Insert|"
- local previousCombo = ""
- local comboString = ""
- local pressedNum = 0
- local powerupsHidden = false
- local IsHandled = {}
- local PowerupPlaces = {}
- local HandlePowerup = function(powerup)
- RunAsync(function()
- if (powerup ~= powerup:GetEffectiveEntity()) then return end
- while not IsDeleted(powerup) do
- PowerupPlaces[powerup] = powerup:GetPlacement()
- local hidePlace = mthQuatVect(mthHPBToQuaternion(0,0,0),mthVector3f(232+mthRndF()*100,3344.2,23*mthRndF()))
- while powerupsHidden and not IsDeleted(powerup) do
- powerup:SetPlacement(hidePlace)
- Wait(Delay(0.25))
- end
- if not IsDeleted(powerup) then
- powerup:SetPlacement(PowerupPlaces[powerup])
- powerup:SetLinearVelocity(mthVector3f(0,0,0))
- PowerupPlaces[powerup] = nil
- Wait(CustomEvent("BFEEnhancedHidePowerups"))
- end
- end
- end)
- end
- while true do
- comboString = ""
- for num,button in pairs(Buttons) do
- if IsKeyPressed(button) then
- comboString = comboString..button.."|"
- end
- end
- if (previousCombo ~= comboString) and (comboString == hideShortcut) then
- powerupsHidden = not powerupsHidden
- if powerupsHidden then
- worldInfo:ShowMessageToAll("Powerups hidden!")
- SignalEvent("BFEEnhancedHidePowerups")
- else
- worldInfo:ShowMessageToAll("Powerups returned!")
- end
- end
- local Powerups = worldInfo:GetAllEntitiesOfClass("CGenericPowerUpItemEntity")
- for i=1,#Powerups,1 do
- if not IsHandled[Powerups[i]] then
- IsHandled[Powerups[i]] = true
- HandlePowerup(Powerups[i])
- end
- end
- previousCombo = comboString
- Wait(CustomEvent("OnStep"))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement