Garry's Mod Wiki

Garry's Mod Wiki

  boolean Player:HasWeapon( string className )

Description

Returns if the player has the specified weapon

Arguments

1 string className
Class name of the weapon

Returns

1 boolean
True if the player has the weapon

Example

prints if the player has the physgun

print( Entity( 1 ):HasWeapon( "weapon_physgun" ) )
Output: "true" in console, if player 1 has Physics Gun.

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

Last Parsed: Loading...