Okay… First of all… I’m editing the sandbox gamemode.
And I got some questions and bugs.
How do I make the Q menu restricted to superadmins from ULX?
I’m also trying to make my derma menu show up when F1 is pressed.
I tried to call the menu two ways. But it still doesnt work.
Here’s my code:
In init.lua it I’ve added this:
AddCSLuaFile( "testingmenuclient.lua" )
and
function GM:ShowHelp(ply)
ply:ConCommand("minmenu")
end
function GM:ShowTeam(ply)
ply:SendLua("testpanel()")
end
And in testingmenuclient.lua I got this:
function testpanel() -- Create the function
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 200, 250 )
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( DermaPanel ) -- Set parent to our "DermaPanel"
DermaButton:SetText( "What does simon like?" )
DermaButton:SetPos( 25, 50 )
DermaButton:SetSize( 150, 50 )
DermaButton.DoClick = function ()
RunConsoleCommand( "say Simon licks balls, but there is nothing wrong with that!" ) -- What happens when you press the button
end
end -- ending the function
concommand.Add( "minmenu", testpanel )
When I press F1 it gives me the error “Unknown command: minmenu”
When I press F2 it gives me this error “:1: attempt to call global ‘testpanel’ (a nil value)”
Can someone help me?