Player/GetWeapon

From Garry's Mod
Jump to: navigation, search
 Player:GetWeapon( )

Contents

Description

Returns the weapon for the specified class

Arguments

string className

Class name of weapon

Returns

Weapon

The weapon for the specified class.

Examples

Example

Prints the weapon if the player has the toolgun

print( Entity(1):GetWeapon( "gmod_tool" ) )

Output:

Something like "Weapon [77]" in console.
Personal tools
Navigation