Player.SetActiveWeapon

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:SetActiveWeapon( Weapon )
Description:
Changes a player's current weapon.
Returns: nil
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.SetActiveWeapon]Player.SetActiveWeapon [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionChanges a player's current weapon to the first one found..
Used onNewerServer.png
Code
 
ply:SetActiveWeapon(ply:GetWeapons()[1])
 
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox