[How do i fix] esx_jobs/server/esx_jobs_sv.lua:34:

Hi guys i am new to developing and i don’t understand why this “esx_jobs/server/esx_jobs_sv.lua:34:” keeps coming up with error when try to wash stones refine oil and trim woods for the jobs i dont understand and confused if some one out there to help me then thank you?

local function Work(source, item)

SetTimeout(item[1].time, function()

    if PlayersWorking[source] == true then

        local xPlayer = ESX.GetPlayerFromId(source)

        if xPlayer == nil then

            return

        end

        for i=1, #item, 1 do

            local itemQtty = 0

            if item[i].name ~= _U('delivery') then  

                itemQtty = xPlayer.getInventoryItem(item[1].db_name).count

            end

            local requiredItemQtty = 0

            if item[1].requires ~= "nothing" then

                requiredItemQtty = xPlayer.getInventoryItem(item[1].requires).count

            end

            if item[i].name ~= _U('delivery') and itemQtty >= item[i].max then

                TriggerClientEvent('esx:showNotification', source, _U('max_limit', item[i].name))

            elseif item[i].requires ~= "nothing" and requiredItemQtty <= 0 then

                TriggerClientEvent('esx:showNotification', source, _U('not_enough', item[1].requires_name))

            else

                if item[i].name ~= _U('delivery') then

                    if not execute_hooks(External.Hooks.overrides.add_item, {xPlayer = xPlayer, item = item[i]}) then                   

                        if item[i].drop == 100 then -- Chances to drop the item

                            xPlayer.addInventoryItem(item[i].db_name, item[i].add)

                        else

                            local chanceToDrop = math.random(100)

                            if chanceToDrop <= item[i].drop then

                                xPlayer.addInventoryItem(item[i].db_name, item[i].add)

                            end

                        end

                    end

Why are we dealing with this? Do you want me to throw out my esx_job file?:pray:

yeah if can be nice i dont know what i did

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.