utils.weapon.getComponent¶
utils.weapon.getComponent(weaponName, weaponComponent)
Arguments¶
Argument | Data Type | Optional | Default Value | Explanation |
---|---|---|---|---|
weaponName | string | No | - | Sets weapon name |
weaponComponent | string | No | - | Sets component of weapon |
Note
You can see all weapons here <Link not create yet>.
Dependency¶
local utils = M("utils")
Example¶
Note
Use utils.weapon.get(weaponName) to find the component or search in weapons.json file.
local weaponComponent = utils.weapon.getComponent('WEAPON_ASSAULTRIFLE', "COMPONENT_ASSAULTRIFLE_CLIP_01")
local tableDump = utils.table.dump(weaponComponent)
print(tableDump) -- Returns all information about this weapon component
local weaponComponent = utils.weapon.getComponent('WEAPON_ASSAULTRIFLE', "COMPONENT_ASSAULTRIFLE_CLIP_01")
print(weaponComponent.label) -- Returns component label of weapon