Player.DropWeapon

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:DropWeapon( Entity Ent )
Description:
Forces a player to drop a specific weapon.
Returns: nil
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.DropWeapon]Player.DropWeapon [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCycles through all players on the server and forces them to drop their Phys Gun.
Used onNewerServer.png
Code
function DropPhysGun()
     for _, v in pairs(player.GetAll()) do
          v:DropWeapon(v:GetWeapon("weapon_physgun"))
     end
end
concommand.Add("dropphys", DropPhysGun)
OutputN/A


Additional notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox