Player.ShouldDropWeapon

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:ShouldDropWeapon( Boolean drop )
Description:
Forces a player to drop his current weapon when he dies.
Returns: nil
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.ShouldDropWeapon]Player.ShouldDropWeapon [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionPlayers drop their current weapons when they die.
Used onNewerServer.png
Code
 
hook.Add("DoPlayerDeath", "drop weapon after death", function(ply)
	ply:ShouldDropWeapon(true);
end);
 
hook.Add("PlayerDeath", "drop weapon after death", function(ply)
	ply:ShouldDropWeapon(false);
end);
 
OutputN/A

Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox