Weapon.SetNextSecondaryFire

From GMod Wiki

Jump to: navigation, search


Function
Syntax Weapon:SetNextSecondaryFire( Float timestamp )
Description:
This function sets when the weapon's secondary attack can fire next. Timestamp should be based off of CurTime().
Returns: nil
In Object: Weapon
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Weapon.SetNextSecondaryFire]Weapon.SetNextSecondaryFire [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSet the secondary fire delay.
Used onNewerServer.png
Code
 
function SWEP:SecondaryAttack()
    --Do the secondary attack...
 
    --Short cooldown. Allow this weapon to fire it's primary attack a half second later.
    self:SetNextSecondaryFire(CurTime()+0.5)
end
 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox