Garry's Mod Wiki

Garry's Mod Wiki

  Panel DMenu:AddOption( string name, function func = nil )

Description

Add an option to the DMenu

Arguments

1 string name
Name of the option.
2 function func = nil
Function to execute when this option is clicked.
Function argument(s):
1 Panel pnl - The DMenuOption that was clicked.

Returns

1 Panel
Returns the created DMenuOption panel.

Example

Creates a DMenu with 2 options: One that kills yourself; One that does nothing.

local m = DermaMenu() m:AddOption( "Suicide", function() RunConsoleCommand("kill") end ) m:AddOption( "It does nothing" ) m:Open()

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...