From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This gets the firing rate to be used when a custom weapon opens fire.


int getWeaponFiringRate ( weapon theWeapon )

OOP Syntax Help! I don't understand this!

Method: weapon:getFiringRate(...)
Variable: .firingRate
Counterpart: setWeaponFiringRate

Required Arguments

  • theWeapon: The weapon to modify the firing rate of.


Returns an integer with the firing rate of the custom weapon, false otherwise.


This example creates a minigun at the center of the map and creates a /firerate command that outputs its firerate to the player who types it.

local weapon = createWeapon("minigun", 0, 0, 3)

function outputMinigunFireRate()
    outputChatBox("Fire rate: " .. getWeaponFiringRate(weapon))
addCommandHandler("firerate", outputMinigunFireRate)


Minimum server version n/a
Minimum client version 1.3.0-9.04555

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.3.0-9.04555" />

See also