setWeaponProperty | Multi Theft Auto: Wiki Skip to content

setWeaponProperty

Client-side
Server-side
Shared

Pair: getWeaponProperty

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function sets the weapon property of the specified weapons specified weapon type. See lower down the page for documentation related to weapon creation.

OOP Syntax Help! I don't understand this!

  • Method:weapon:setProperty(...)

Syntax

bool setWeaponProperty ( int weaponID/string weaponName, string weaponSkill, string property, int/float theValue )
Required Arguments
  • weaponID/string weaponName: MISSING_PARAM_DESC
  • weaponSkill: MISSING_PARAM_DESC
  • property: MISSING_PARAM_DESC
  • theValue: MISSING_PARAM_DESC

Returns

  • bool: value

On success:

Code Examples

shared

This example sets the weapon range of the M4 at poor skill level to 75

local rangeSet = setWeaponProperty(31, "poor", "weapon_range", 75)
if (rangeSet) then
outputChatBox("M4 range at poor skill is set now 75!")
end