Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. local Clockwork = Clockwork;
  2. local PLUGIN = PLUGIN;
  3.  
  4. function PLUGIN:PlayerButtonDown(player, key)
  5.     if (not IsFirstTimePredicted()) then return end
  6.    
  7.     local activeWeapon = player:GetActiveWeapon():GetClass();
  8.    
  9.     if (activeWeapon == "cw_stunstick") and (key == 13) then
  10.    
  11.     Schema.HighVoltageButtonPanel = vgui.Create("cwHighVoltageButtonPanel");
  12.     Schema.MediumVoltageButtonPanel = vgui.Create("cwMediumVoltageButtonPanel");
  13.     Schema.LowVoltageButtonPanel = vgui.Create("cwLowVoltageButtonPanel");
  14.  
  15.     Schema.HighVoltageButtonPanel:MakePopup();
  16.     Schema.MediumVoltageButtonPanel:MakePopup();
  17.     Schema.LowVoltageButtonPanel:MakePopup();
  18.     end;
  19. end;
  20.  
  21. function PLUGIN:PlayerButtonUp(player, key)
  22.     if (not IsFirstTimePredicted()) then return end
  23.    
  24.     local activeWeapon = player:GetActiveWeapon():GetClass();
  25.    
  26.     if (activeWeapon == "cw_stunstick") and (key == 13) then
  27.    
  28.     Schema.HighVoltageButtonPanel:Close();
  29.     Schema.MediumVoltageButtonPanel:Close();
  30.     Schema.LowVoltageButtonPanel:Close();
  31.     end;
  32. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement