Garry's Mod Wiki

SANDBOX:PreReloadToolsMenu

  SANDBOX:PreReloadToolsMenu()

Description

Called right before the Lua Loaded tool menus are reloaded.

Example

Removes some tools from the spawnmenu tab. Note: the player can still take them (e.g. via console command).

-- The tools that we are going to hide from the menu. local toolsToHide = { weld = true, rope = true, } hook.Add( "PreReloadToolsMenu", "HideTools", function() -- Tool contains information about all registered tools. for name, data in pairs( weapons.GetStored( "gmod_tool" ).Tool ) do if toolsToHide[ name ] then data.AddToMenu = false end end end )