Weapon/SetHoldType

From Garry's Mod
Jump to: navigation, search
 Weapon:SetHoldType( )

Contents

Description

Sets the hold type of the weapon. This function also calls WEAPON:SetWeaponHoldType and properly networks it to all clients.

NOTE

This only works on scripted weapons.

BUG

Using this function on weapons held by bots will not network holdtype changes to clients if the world model is set to an empty string (SWEP.WorldModel = "").

Arguments

string name

Name of the hold type. You can find all default hold types here

Examples

Example

Puts a players hands down by its sides on reload.

function SWEP:Reload()
	self:SetHoldType( "normal" )
end


Personal tools
Navigation