Error


citizen:/scripting/lua/scheduler.lua:479: attempt to concatenate a nil value (local

PS-Dispatch Export

Exports – Follow This If Needed


Since you’re adding exports that already exists in ps-dispatch do the following

exports['ps-dispatch']:VangelicoRobbery(camId)
exports['ps-dispatch']:SuspiciousActivity()

These are the exports you will want to use for qb-jewelry


Go to qb-jewelry > client > main.lua

Find this function

local function smashVitrine(k)

This function has 2 ways to call police

TriggerServerEvent('police:server:policeAlert', 'Suspicious Activity') -- For the first alarm
TriggerServerEvent('police:server:policeAlert', 'Robbery in progress') -- For the actual robbery

These are the events you will be replacing below.


Suspicious activity export

Change

TriggerServerEvent('police:server:policeAlert', 'Suspicious Activity')

to

exports['ps-dispatch']:SuspiciousActivity()

Robbery In Progress Export

Change

TriggerServerEvent('police:server:policeAlert', 'Robbery in progress')

to

exports['ps-dispatch']:VangelicoRobbery(camId)

Finished function

After you’re done it should look like this.

local function smashVitrine(k)
    if not firstAlarm then
        exports['ps-dispatch']:SuspiciousActivity()
        firstAlarm = true
    end

    QBCore.Functions.TriggerCallback('qb-jewellery:server:getCops', function(cops)
        if cops >= Config.RequiredCops then
            local animDict = 'missheist_jewel'
            local animName = 'smash_case'
            local ped = PlayerPedId()
            local plyCoords = GetOffsetFromEntityInWorldCoords(ped, 0, 0.6, 0)
            local pedWeapon = GetSelectedPedWeapon(ped)
            if math.random(1, 100) <= 80 and not QBCore.Functions.IsWearingGloves() then
                TriggerServerEvent('evidence:server:CreateFingerDrop', plyCoords)
            elseif math.random(1, 100) <= 5 and QBCore.Functions.IsWearingGloves() then
                TriggerServerEvent('evidence:server:CreateFingerDrop', plyCoords)
                QBCore.Functions.Notify(Lang:t('error.fingerprints'), 'error')
            end
            smashing = true
            QBCore.Functions.Progressbar('smash_vitrine', Lang:t('info.progressbar'), Config.WhitelistedWeapons[pedWeapon]['timeOut'], false, true, {
                disableMovement = true,
                disableCarMovement = true,
                disableMouse = false,
                disableCombat = true,
            }, {}, {}, {}, function() -- Done
                TriggerServerEvent('qb-jewellery:server:vitrineReward', k)
                TriggerServerEvent('qb-jewellery:server:setTimeout')
                exports['ps-dispatch']:VangelicoRobbery(camId)
                smashing = false
                TaskPlayAnim(ped, animDict, 'exit', 3.0, 3.0, -1, 2, 0, 0, 0, 0)
            end, function() -- Cancel
                TriggerServerEvent('qb-jewellery:server:setVitrineState', 'isBusy', false, k)
                smashing = false
                TaskPlayAnim(ped, animDict, 'exit', 3.0, 3.0, -1, 2, 0, 0, 0, 0)
            end)
            TriggerServerEvent('qb-jewellery:server:setVitrineState', 'isBusy', true, k)

            CreateThread(function()
                while smashing do
                    loadAnimDict(animDict)
                    TaskPlayAnim(ped, animDict, animName, 3.0, 3.0, -1, 2, 0, 0, 0, 0)
                    Wait(500)
                    TriggerServerEvent('InteractSound_SV:PlayOnSource', 'breaking_vitrine_glass', 0.25)
                    loadParticle()
                    StartParticleFxLoopedAtCoord('scr_jewel_cab_smash', plyCoords.x, plyCoords.y, plyCoords.z, 0.0, 0.0, 0.0, 1.0, false, false, false, false)
                    Wait(2500)
                end
            end)
        else
            QBCore.Functions.Notify(Lang:t('error.minimum_police', { value = Config.RequiredCops }), 'error')
        end
    end)
end

Also make sure that ps-dispatch is started before qb-jewelry


Hope this helps :slight_smile: