# Script Integrations

If you want to use your own server scripts, the main integration locations are:

* Inventory: `modules/inventory/server.lua`
* Target: `modules/target/client.lua`
* Notify, text UI, clothing, HUD, vehicle keys, fuel, progressbar, and skillcheck: `modules/utils/client.lua`
* Framework loader: `modules/bridge/init.lua`
* Framework bridge files: `modules/bridge/esx`, `modules/bridge/qb`, and `modules/bridge/qbx`

## Inventory Integration

File: `modules/inventory/server.lua`

This file handles:

* Give item
* Remove item
* Has item
* Get item count

Example:

```lua
function Inventory.giveItem(source, itemName, count)
    return exports["my_inventory"]:AddItem(source, itemName, count)
end
```

## Target Integration

File: `modules/target/client.lua`

By default the script supports:

* `ox_target`
* `qb-target`

This version uses:

* Box zones
* Local entity interactions
* Model interactions
* Global vehicle interactions

If you use another target system, this is the file you replace.

## Notify, Text UI, Clothing, HUD, Keys, Fuel

File: `modules/utils/client.lua`

This is the main custom integration file for V2.

Common changes:

* Replace `lib.notify`
* Replace `lib.showTextUI` and `lib.hideTextUI`
* Replace clothing loader
* Replace HUD visibility export
* Replace vehicle key logic
* Replace fuel setter

## Progressbar and Skillcheck

File: `modules/utils/client.lua`

V2 already wraps these helpers:

```lua
Utils.progressBar(data)
Utils.skillCheck(difficulty, inputs)
```

If you use your own scripts, replace those functions only and keep the same return behavior.

Example:

```lua
function Utils.progressBar(data)
    return exports["my_progressbar"]:Progress(data)
end
```

## Framework Integration

Files:

* `modules/bridge/init.lua`
* `modules/bridge/esx/*`
* `modules/bridge/qb/*`
* `modules/bridge/qbx/*`

Use these files if your player loaded events or framework object access differ from the default supported versions.

## Safest Way To Integrate

Use this order:

1. Keep function names and returned values the same.
2. Replace only the export or event lines.
3. Test all 3 default scenarios after editing integrations.


---

# 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://docs.0resmon.org/0resmon/0r-resources/0r-garbage-v2/integrations.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.
