WEAPON:Holster

From Garry's Mod
Jump to: navigation, search
 WEAPON:Holster( )

Contents

Description

Called when weapon tries to holster.

NOTE This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.

Arguments

Entity weapon

The weapon we are trying switch to.

Returns

boolean

Return true to allow weapon to holster

Examples

Example

Returns the weapon switched to when when the weapon is being holstered.

function SWEP:Holster( wep )
	if not IsFirstTimePredicted() then return end
	LocalPlayer():ChatPrint("Switched to: "..(wep.PrintName or wep:GetClass()))
end

Output:

Switched to Toolgun Switched to weapon_crowbar
Personal tools
Navigation