Garry's Mod Wiki

controlpanel.Get

Description

Returns (or creates if not exists) a control panel.

Arguments

1 string name
The name of the panel. For normal tools this will be equal to TOOL.Mode (the tool's filename without the extension).

When you create a tool/option via spawnmenu.AddToolMenuOption, the internal control panel name is TOOL.Mode .. "_" .. tool_tab:lower() .. "_" .. tool_category:lower().

Returns

1 Panel
The ControlPanel panel.

Example

Get the Contextmenus panel for the weld tool.

local ControlPanel = controlpanel.Get( "Weld" )