# QBOX Installation

ONE SYNC (WITH INFINITY) IS REQUIRED.

* REMOVE QBX\_AMBULANCEJOB AND QBX\_MEDICAL.
* REMOVE QBX\_AMBULANCEJOB AND QBX\_MEDICAL.
* REMOVE QBX\_AMBULANCEJOB AND QBX\_MEDICAL.
* REMOVE QBX\_AMBULANCEJOB AND QBX\_MEDICAL.
* REMOVE QBX\_AMBULANCEJOB AND QBX\_MEDICAL.
* REMOVE QBX\_AMBULANCEJOB AND QBX\_MEDICAL.

### Metadata

Add these entries for metadata in qbx\_core/server/player.lua if you do NOT have them already.

{% code fullWidth="false" %}

```lua
playerData.metadata.bleeding = playerData.metadata.bleeding or 0
```

{% endcode %}

### REMOVE BANDAGE FROM OX INVENTORY.

```lua
-- REMOVE THIS FROM ox_inventory/modules/items/client.lua
Item('bandage', function(data, slot)
    local maxHealth = GetEntityMaxHealth(cache.ped)
    local health = GetEntityHealth(cache.ped)
    ox_inventory:useItem(data, function(data)
        if data then
            SetEntityHealth(cache.ped, math.min(maxHealth, math.floor(health + maxHealth / 16)))
            lib.notify({ description = 'You feel better already' })
        end
    end)
end)

-- EDIT the BANDAGE item from ox_inventory/data/items.lua (if it exists) so it looks like this
['bandage'] = {
    label = 'Bandage',
    weight = 115,
    consume = 0,
    server = {
        export = 'randol_medical.bandage',
    },
},
-- Add these items below if you wish to use them.
["firstaid"] = {
    label = "First Aid",
    weight = 2000,
    stack = true,
    close = true,
    description = "",
    consume = 0,
    client = { image = "firstaid.png", },
    server = {
        export = 'randol_medical.firstaid',
    },
},
["medicalbag"] = {
    label = "Medical Bag",
    weight = 500,
    stack = true,
    close = true,
    consume = 0,
    description = "A medical bag.",
    client = { image = "medicalbag.png", },
    server = { export = 'randol_medical.medicalbag', },
},
```

### Adding new heal items

If adding a new heal item to the Server.HealItems table, you can simply add them to ox inventory items.lua like the following example:

```lua
["exampleitem"] = {
    label = "Example Item",
    weight = 500,
    stack = true,
    close = true,
    consume = 0,
    description = "A heal item.",
    client = { image = "exampleitem.png", },
    server = { export = 'randol_medical.exampleitem', },
},
```

## Hunger/Thirst Loop

Located here: <https://github.com/Qbox-project/qbx_core/blob/main/client/loops.lua>. Replace with below.

```lua
local statusInterval = require 'config.client'.statusIntervalSeconds
local playerState = LocalPlayer.state

CreateThread(function()
    local timeout = 1000 * statusInterval
    while true do
        Wait(timeout)

        if QBX.IsLoggedIn then
            if ((playerState.hunger or 0) <= 0 or (playerState.thirst or 0) <= 0) and not playerState.dead and not playerState.laststand then
                local currentHealth = GetEntityHealth(cache.ped)
                local decreaseThreshold = math.random(5, 10)
                SetEntityHealth(cache.ped, currentHealth - decreaseThreshold)
            end
        end
    end
end)
```


---

# Agent Instructions: 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:

```
GET https://randolio.gitbook.io/docs/paid-scripts/medical/qbox-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
