Skip to content

utils.weapon.get

utils.weapon.get(weaponName)
This function gets all information about a weapon.

Arguments

Argument Data Type Optional Default Value Explanation
weaponName string No - Sets weapon name

Note

You can see all weapons here <Link not create yet>.

Dependency

local utils = M("utils")

Example

local iteration, weapon = utils.weapon.get("WEAPON_ASSAULTRIFLE")
local dumpedTable = utils.table.dump(weapon)

print(iteration, weapon) -- Returns 194 and table: 00000000D35BBFE0
print(dumpedTable) -- Returns all information about that weapon
local iteration, weapon = utils.weapon.get("WEAPON_ASSAULTRIFLE")
print(weapon.label) -- Returns weapon label
local iteration, weapon = utils.weapon.get("WEAPON_ASSAULTRIFLE")

for k,v in ipairs(weapon.components) do
    print(v.label) -- Returns components labels
end

Improve this documentation