Advertisement
Guest User

custom menu lua

a guest
Jul 28th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. [ERROR] gamemodes/test/gamemode/custom_menu.lua:5: attempt to index global 'vgui' (a nil value)
  2.   1. unknown - gamemodes/test/gamemode/custom_menu.lua:5
  3.    2. unknown - lua/includes/modules/concommand.lua:54
  4.  
  5.  
  6. local Menu
  7.  
  8. function gameMenu()
  9.     if (Menu == nil) then
  10.         Menu = vgui.Create( "DFrame" )
  11.         Menu:SetSize(500,500)
  12.         Menu:SetTitle("GameMode")
  13.         Menu:SetDraggable(false)
  14.         Menu:ShowCloseButton(false)
  15.         Menu:SetPos(ScrW()/2 - 250, ScrH()/ 2 - 250)
  16.         Menu:SetDeleteOnClose(false)
  17.         Menu.Paint = function()
  18.             surface.SetDrawColor(60,60,60,255)
  19.             surface.DrawRect(0,0,Menu:GetWide(),Menu:GetTall() )
  20.            
  21.             surface.SetDrawColor(40,40,40,255)
  22.             surface.DrawRect(0,24,Menu:GetWide(),1)
  23.         end
  24.     else
  25.         if (Menu:IsVisible()) then
  26.             Menu:SetVisible(false)
  27.             gui.EnableScreenClicker(false)
  28.         else
  29.             Menu:SetVisible(true)
  30.             gui.EnableScreenClicker(true)
  31.         end
  32.     end
  33. end
  34.  
  35. concommand.Add("open_game_menu", gameMenu)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement