Garry's Mod Wiki

Garry's Mod Wiki

  Weapon Player:GetWeapon( string className )

Description

Returns the weapon for the specified class

Arguments

1 string className
Class name of weapon

Returns

1 Weapon
The weapon for the specified class, or NULL ENTITY if the player does not have this weapon.

Example

Prints the weapon if the player has the toolgun

print( Entity( 1 ):GetWeapon( "gmod_tool" ) )
Output: Something like "Weapon [77]" in console.

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 twice a day. Edits and history are not available.

Last Parsed: Loading...