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

Session 0
DB GetPage 4
Generate Html 4
SaveChanges 8
Render Body 0
Render Sidebar 11