SWEP.Deploy
From GMod Wiki
Revision as of 18:17, 7 June 2010 by Crazy Quebecer (Talk | contribs)
Event Hook | |
Hook Name | Deploy |
Syntax | SWEP:Deploy( ) |
Description | Called when you bring out the SWEP. |
Returns | Boolean |
Lua State | |
BBCode | [b][url=wiki.garrysmod.com/?title=SWEP.Deploy]SWEP.Deploy [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | Sets the weapon animation to draw once you bring it out. |
---|---|
Used on | |
Code | function SWEP:Deploy() self:SendWeaponAnim(ACT_VM_DRAW) return true end |
Output | N/A |
Additional Notes
- Remember to return true! If you do not return anything or return false, you will dissallow equipping of this weapon.
- For some reason, the first time a player spawns only the server (not the client) will run this function. After that both client and server will call the function when you select a new weapon.