Gamemode.WeaponEquip
From GMod Wiki
| Event Hook | |
| Hook Name | WeaponEquip |
| Syntax | GM:WeaponEquip( Weapon Weapon ) |
| Description | Called as a weapon entity is picked up by a player. |
| Returns | Nil |
| Lua State | |
| BBCode | [b][url=wiki.garrysmod.com/?title=Gamemode.WeaponEquip]Gamemode.WeaponEquip [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- At the time this hook is called, the weapon doesn't have an owner. wep:GetOwner will return a Null Entity. The Weapon Owner is set on the next frame. I found it easiest to use timer.Simple to get around this problem. As shown in the example above.
- Don't use this to prevent people picking up weapons. Use the Gamemode.PlayerCanPickupWeapon instead for that.