Weapon.SetNextPrimaryFire

From GMod Wiki

Jump to: navigation, search


Function
Syntax Weapon:SetNextPrimaryFire( Float timestamp )
Description:
This function sets when the weapon 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.SetNextPrimaryFire]Weapon.SetNextPrimaryFire [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSet the primary fire delay.
Used onNewerServer.png
Code
function SWEP:PrimaryAttack()
    --Do the primary attack...
 
    --Long, LONG cooldown. Allow this weapon to fire it's primary attack 25 seconds later.
    self:SetNextPrimaryFire(CurTime()+25)
end
OutputNone


Additional info

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox