Common Errors

If you use ESX 1.8.5 and get the following error, then replace the following code in ESX.

SCRIPT ERROR: @es_extended/common/functions.lua:54: bad argument #1 to 'upper' (string expected, got table)

So if you get this error when adding a Weapon Component go to es_extended/server/classes/player.lua and search for function self.addWeaponComponent(weaponName, weaponComponent).

Replace this functions with this one:

function self.addWeaponComponent(weaponName, weaponComponent)
    local loadoutNum, weapon = self.getWeapon(weaponName)

    if weapon then
        local component = ESX.GetWeaponComponent(weaponName, weaponComponent)

        if component then
            if not self.hasWeaponComponent(weaponName, weaponComponent) then
                self.loadout[loadoutNum].components[#self.loadout[loadoutNum].components + 1] = weaponComponent
                GiveWeaponComponentToPed(GetPlayerPed(self.source), joaat(weaponName), component.hash)
                self.triggerEvent('esx:addInventoryItem', component.label, false, true)

Last updated