Player/HasWeapon

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

Contents

Description

Returns if the player has the specified weapon

Arguments

string className

Class name of the weapon

Returns

boolean

True if the player has the weapon

Examples

Example

prints if the player has the physgun

print(player.GetByID(1):HasWeapon("weapon_physgun"))

Output:

"true" in console, if player 1 has Physics Gun.
Personal tools
Navigation