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: 26ms

Session 0
DB GetPage 3
Generate Html 3
SaveChanges 13
Render Body 0
Render Sidebar 5