getWeaponFiringRate
Client-side
Server-side
Shared
Pair: setWeaponFiringRate
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This gets the firing rate to be used when a custom weapon opens fire.
OOP Syntax Help! I don't understand this!
- Method: weapon:getFiringRate(...)
- Variable: .firingRate
Syntax
int getWeaponFiringRate ( weapon theWeapon )Required Arguments
- theWeapon: The weapon to modify the firing rate of.
Returns
- int: value
Returns an integer with the firing rate of the custom weapon, false otherwise.
Code Examples
shared
This example creates a minigun at the center of the map and creates a/fireratecommand that outputs its firerate to the player who types it.
local weapon = createWeapon("minigun", 0, 0, 3)
function outputMinigunFireRate() outputChatBox("Fire rate: " .. getWeaponFiringRate(weapon))endaddCommandHandler("firerate", outputMinigunFireRate)