General > Developers Corner
Console Command by Button
(1/1)
riki137:
--- Code: ---local window = vgui.Create( "DFrame" )
window:SetSize( 200,70 )
window:Center()
window:SetTitle( "DButton Test" )
window:MakePopup()
local button = vgui.Create( "DButton", window )
button:SetSize( 100, 30 )
button:SetPos( 50, 30 )
button:SetText( "Test Button" )
button.DoClick = function( button )
-- What function here to do a console command
end
--- End code ---
Megiddo:
RunConsoleCommand is your best option.
riki137:
Thanks, i'm really just a beginner ::)
Megiddo:
No problem, just spend some time exploring the gmod wiki. :)
Navigation
[0] Message Index
Go to full version