Skip to content

utils.weapon.getFromHash

utils.weapon.getFromHash(weaponHash)
This function gets the weapon for through the hash.

Arguments

Argument Data Type Optional Default Value Explanation
weaponHash int No - Sets weapon hash

Note

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

Dependency

local utils = M("utils")

Example

local weaponHash = utils.weapon.getFromHash(-1074790547) -- 'WEAPON_ASSAULRIFLE'
local tableDump = utils.table.dump(weaponHash)

print(tableDump) -- Returns all information about weapon
local weaponHash = utils.weapon.getFromHash(-1074790547) -- 'WEAPON_ASSAULRIFLE'

print(weaponHash.description) -- Returns description of weapon

Improve this documentation