Garry's Mod Wiki

Garry's Mod Wiki

  list.Set( string identifier, any key, any item )

Description

Sets a specific position in the named list to a value.

Arguments

1 string identifier
The list identifier
2 any key
The key in the list to set
3 any item
The item to set to the list as key

Example

Adds an NPC to the spawnmenu NPC list with the name "Fisherman", classname of "npc_fisherman" and the default weapon of "weapon_oldmanharpoon"

-- Lost Coast list.Set("NPC", "npc_fisherman", { Name = "Fisherman", Class = "npc_fisherman", Weapons = { "weapon_oldmanharpoon" }, Category = Category })

Example

Adds a new "Desktop Widget" to the Context Menu (C Menu). (This is how Player Model selection is added)

list.Set( "DesktopWindows", "My Custom Context Menu Icon", { title = "Context Menu Icon", icon = "icon64/icon.png", init = function( icon, window ) --Your code here end } )

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