getWeaponProperty
Client-side
Server-side
Shared
Pair: setWeaponProperty
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This function gets a weapon property of the specified custom weapon (clientside only) or specified player-held weapon (both client and server).
OOP Syntax Help! I don't understand this!
Note: This OOP syntax is forcustom weaponsonly.
- Method: weapon:getProperty(...)
Syntax
int getWeaponProperty ( int weaponID/string weaponName, string weaponSkill, string property )Required Arguments
- weaponID/string weaponName: MISSING_PARAM_DESC
- weaponSkill: MISSING_PARAM_DESC
- property: MISSING_PARAM_DESC
Returns
- int: value
On success:
Code Examples
shared
This example gets the weapon range of the M4 at poor skill level
local range = getWeaponProperty(31, "poor", "weapon_range")outputChatBox("M4 range at poor is: "..tostring(range))