SolvedGMod OpenDerma Command

Posts 1–5 of 5 · Page 1 of 1
GMod OpenDerma Command
I have this code but I can't figure out why I cant get my console command to work. Any help would be appreciated!


Code:
local midx, midH = ScrW() / 2, ScrH() / 2
local function OpenMyDerma()
local MyDerma = vgui.Create( "DFrame" )
MyDerma:SetSize( 800,400 )
MyDerma:SetPos( 400,150 )
MyDerma:MakePopup()

concommand.Add("+jollyopen", MyDerma:SetVisible(true))

local Button1 = vgui.Create( "DButton", MyDerma )
Button1:SetText( "Mic Forced On" )
Button1:SetSize( 100,50 )
Button1:SetPos( 30,35 )
Button1.DoClick = function()
RunConsoleCommand("+voicerecord")
end

local Button2 = vgui.Create( "DButton", MyDerma )
Button2:SetText( "Mic Forced Off" )
Button2:SetSize( 100,50 )
Button2:SetPos( 30,100 )
Button2.DoClick = function()
RunConsoleCommand("-voicerecord")
end

MyDerma.Paint = function()
draw****undedBox( 12, 0, 0, MyDerma:GetWide(), MyDerma:GetTall(),
Color(255,0,255,150) )

Button2.Paint = function( s , w , h )
draw****undedBox( 12, 0, 0, 
Color( 255, 255, 0, 150 ) ) -- Draw a blue button
end

Button1.Paint = function( s , w , h )
draw****undedBox( 12, 0, 0, 
Color( 255, 255, 0, 150 ) ) -- Draw a blue button
end
end
end
Update: It has been solved.
/Moved to the correct section.
concommand.Add("+jollyopen", OpenMyDerma) Replace that for
concommand.Add("+jollyopen", MyDerma:SetVisible(true))
He would need to move concommand.Add out of the function aswell or else it will never be run
/Solved & closed.
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us