Tool/GetMode

From Garry's Mod
Jump to: navigation, search
 Tool:GetMode( )

Contents

Description

Returns the name of the current tool mode.

Returns

string

The current tool mode.

Examples

Example

The Toolgun weapon has a similar function, checking weapon class is strongly recommended as GetMode() is not available on all weapons.

local wep = Entity( 1 ):GetActiveWeapon()
if ( IsValid( wep ) && wep:GetClass() == "gmod_tool" ) then
	print( wep:GetMode() )
end

Output:

remover
Personal tools
Navigation