> For the complete documentation index, see [llms.txt](https://docs.av-scripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.av-scripts.com/laptop-pack-v3/business/installation/inventories/quasar-inventory/qbcore.md).

# QBCore

* This guide only applies if you are using **QBCore and Quasar Inventory**.
* Go to **qb-core/server/main.lua** and add this code at the bottom:

```lua
local decayTypes = { -- float or false. The higher the value, the faster it wears out
    ['food'] = false, -- 0.07 (for example)
    ['drink'] = false,
    ['joint'] = false,
    ['alcohol'] = false,
}

AddEventHandler('inventory:refresh', function()
    local success, items = pcall(MySQL.query.await, 'SELECT * FROM av_items')
    if success and items and next(items) then
        local path = GetResourcePath('qs-inventory')
        for i = 1, #items do
            local item = items[i]
            if not QBShared.Items[item['name']] then
                QBShared.Items[item['name']] = {
                    name = item['name'],
                    label = item['label'],
                    weight = item['weight'],
                    type = 'item',
                    decay = decayTypes[item['type']] or false,
                    image = item['name']..'.png',
                    unique = true,
                    useable = true,
                    shouldClose = true,
                    combinable = {},
                    description = item['description']
                }
                if item.image then
                    PerformHttpRequest(item.image, function (errorCode, resultData, resultHeaders)
                        if errorCode >= 200 and errorCode < 300 then
                            local image = assert(io.open(path..'/html/images/'..item.name..'.png', "wb"))
                            image:write(resultData)
                            image:flush()
                            image:close()
                        end
                    end)
                end
            end
        end
        TriggerEvent("quasar:refresh")
    end
end)
```

* Go to **qs-inventory/server/custom/framework/qb.lua** and add this event at bottom

```lua
RegisterNetEvent('quasar:refresh', function()
    QBCore = exports['qb-core']:GetCoreObject()
    ItemList = QBCore.Shared.Items
end)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.av-scripts.com/laptop-pack-v3/business/installation/inventories/quasar-inventory/qbcore.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
