Garry's Mod Wiki

Player:GetWeapon

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.

Example

Prints the weapon if the player has the toolgun

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

Page Links


Special Pages


Wikis

?

Render Time: 32ms

DB GetPage 3
Generate Html 5
SaveChanges (1) 8
Render Body 0
Render Sidebar 12