Garry's Mod Wiki

Player:HasWeapon

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(player.GetByID(1):HasWeapon("weapon_physgun"))
Output: "true" in console, if player 1 has Physics Gun.

Page Links


Special Pages


Wikis

?

Render Time: 31ms

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