Garry's Mod Wiki

Garry's Mod Wiki

  DButton:SetConsoleCommand( string command, string args = nil )

Description

Sets a console command to be called when the button is clicked.

This overrides the button's DoClick method.

Arguments

1 string command
The console command to be called.
2 string args = nil
The arguments for the command.

Example

Creates a button that makes the player say their name.

local button = vgui.Create( "DButton" ) button:SetSize( 100, 35 ) button:SetText( "Say your nickname" ) button:Center() button:MakePopup() button:SetConsoleCommand( "say", LocalPlayer():Nick() )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...