[help] getinventoryitem

hello i need help with this code

RegisterServerEvent('esx_jobcenter:bono')
AddEventHandler('esx_jobcenter:bono',function()
    local xPlayer = ESX.GetPlayerFromId(source)
    if xPlayer then
        local xBono = xPlayer.getInventoryItem('bono')
        if xBono then
                    xPlayer.addMoney(100000)
                    xPlayer.removeInventoryItem('bono', 1)
        end
    end
end)

i need to give to the player money only when they have a item called bono,
and the player its on a specific point

Moved to #server-development:essentialmode

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