spawnmenu.GetTools

From GMod Wiki

Jump to: navigation, search
Function
Syntax spawnmenu.GetTools( )
Where is this used?
Description:
Returns a list of the tools used on the client.
Returns: Table
Part of Library: spawnmenu
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Spawnmenu.GetTools]Spawnmenu.GetTools [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis will return a list of your tools.
Used onNewerClient.png
Code
 
local tools = {}
 
tools = spawnmenu.GetTools()[1].Items
 
for a,b in ipairs(tools) do
	for c,d in ipairs(tools[a]) do
		print(d.ItemName)
	end
end
 
OutputA list of all of your tools, can be used to make a list of tools.


Additional Notes

You can use ".Items, .Icon, .Name, or .Label" with spawnmenu.GetTools(), but keep in mind those are strings that will return information about the table. Also instead of .ItemName you can use ".Controls, .Command, or .Text".

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox