Skip to content

xPlayer.getWeapon

1
xPlayer.getWeapon(weaponName)

This functions returns if the loadoutNum and a weapon object for the weapon if the player has it.

xPlayer.getWeapon Example

1
2
3
4
5
6
7
    local loadoutNum, weapon = xPlayer.getWeapon('WEAPON_PISTOL')

    if weapon then
        print(xPlayer.loadout[loadoutNum].label)
    else
        print('weapon not found!')
    end