SWEP.Initialize

From GMod Wiki

Revision as of 11:22, 15 June 2010 by Unrealomega (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameInitialize
SyntaxSWEP:Initialize( )
DescriptionCalled when the weapon entity is created.
ReturnsNil
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=SWEP.Initialize]SWEP.Initialize [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]

Example

DescriptionSetting up values when the weapon is initialized.
Used onNewerShared.png
Code
function SWEP:Initialize()
 
	self:SetWeaponHoldType( self.HoldType )	
	self:SetNetworkedBool( "Ironsights", false )
 
end
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox