Simple Menu

Edit:
Found derma, Just need to learn how to make it toggleable

-Thanks mikey

Using concommand.Add(“command”, frame)

Now I am just getting mad because I’ve been editing it for the past hour or so and it doesn’t work. Can somebody please show me an example? This is what I have



 function WhenGameStarts()  
    BuildYourPanel() -- Make sure the frame is built when we start. 
Refer to the timer.Simple() bellow 
  end

   local DermaPanel = vgui.Create( "DFrame" ) -- Creates the frame itself   
    DermaPanel:SetPos( 50,50 ) -- Position on the players screen   
    DermaPanel:SetSize( 1000, 900 ) -- Size of the frame   
    DermaPanel:SetTitle( "Testing Derma Stuff" ) -- Title of the frame   
    DermaPanel:SetVisible( true )   
    DermaPanel:SetDraggable( true ) -- Draggable by mouse?   
    DermaPanel:ShowCloseButton( true ) -- Show the close button?   
    DermaPanel:MakePopup() -- Show the frame    
end
     
    function BuildYourPanel()  
         
        YourFrame = vgui.Create( "DFrame" )  
        YourFrame:SetTitle( "Derma Testing Stuff" )  
        YourFrame:ShowCloseButton( false ) -- Make sure no one presses the close button and get UBER error spam  
       YourFrame:SetPos( 50, 50 )  
       YourFrame:SetSize( 250, 250 )  
       YourFrame:SetDraggable( false ) -- Make sure they can't move it  
      
           /*  
 local DermaButton = vgui.Create( "DButton", TestingPanel )  
 DermaButton:SetText( "CheezeBurger)  
 DermaButton:SetPos( 20, 10 )  
 DermaButton:SetSize( 200, 100 )  
 DermaButton.DoClick = function ()  
     RunConsoleCommand( "say CheezeBurger" )  
end  
           */  
      
       YourFrame:SetVisible( false )  
       gui.SetMousePos( ScrW() / 2, ScrH() / 2 )  
      
  end  
      
   timer.Simple( 5, function() -- Make a timer when the game starts so we don't get errors  
   WhenGameStarts()  
   BuildYourPanel() -- Make the panel itself  
   end )  
      
   function HidePanel() -- Function that hides the panel  
       if YourFrame then -- Validate that our frame is there  
           YourFrame:SetVisible( false )  
       end  
       gui.EnableScreenClicker( false )  
   end  
      
   function ShowPanel() -- Function that opens the panel  
       if YourFrame then -- Validate that our frame is there  
           YourFrame:SetVisible( true )  
       end  
       gui.EnableScreenClicker( true )  
   end  
     
   function KeyPressed(ply, key)  
       if key == IN_RELOAD then  
           ShowPanel()  
       end  
   end   
   hook.Add( "KeyPress", "KeyPressedHook", KeyPressed )  
     
   function KeyRelease(ply, key)  
       if key == IN_RELOAD then  
           HidePanel()  
       end  
   end   
   hook.Add( "KeyRelease", "KeyReleasedHook", KeyRelease )