DButton.SetConsoleCommand

From GMod Wiki

Jump to: navigation, search
Function
Syntax DButton:SetConsoleCommand( String Command [, String argument 1, String argument 2, ...] )
Description:
Set the button to execute a console command when pressed.
Returns: nil
In Object: DButton
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DButton.SetConsoleCommand]DButton.SetConsoleCommand [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionWhen you press the button you will say "hi"
Used onNewerClient.png
Code
local Clicker = vgui.Create("DButton", Frame)
Clicker:SetText("Clicker")
Clicker:SetSize(280, 75)
Clicker:SetPos(10,150)
Clicker:SetConsoleCommand("say", "hi")
OutputYOU: hi


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox