# Compatibility

MOH Business System detects your installed inventory and target resources automatically when both are set to `'auto'` in `config.lua`. You can also pin a specific resource if auto-detection picks the wrong one.

## Supported Inventory Resources

The inventory resource is used exclusively for resolving item image paths shown in the UI. Actual item giving and taking is handled through QBCore's standard player functions.

| Resource          | Config Value         | Image Path                                |
| ----------------- | -------------------- | ----------------------------------------- |
| ox\_inventory     | `'ox_inventory'`     | `nui://ox_inventory/web/images/`          |
| ps-inventory      | `'ps-inventory'`     | `nui://ps-inventory/html/images/items/`   |
| codem-inventory   | `'codem-inventory'`  | `nui://codem-inventory/html/images/`      |
| origen\_inventory | `'origen_inventory'` | `nui://origen_inventory/html/imgs/items/` |
| qb-inventory      | `'qb-inventory'`     | `nui://qb-inventory/html/images/`         |

If your inventory is not listed above, it falls back to the path in `Config.ItemImageFallback` (default: `nui://qb-inventory/html/images/`). You can add your custom inventory to `Config.ItemImagePaths` in `config.lua`:

```lua
Config.ItemImagePaths['my-custom-inventory'] = 'nui://my-custom-inventory/html/images/'
```

## Auto-Detection Order

When `Config.InventoryResource` is set to `'auto'`, the resource checks for each inventory in the following order and uses the first one that is in a started state:

1. ox\_inventory
2. ps-inventory
3. codem-inventory
4. origen\_inventory
5. qb-inventory (fallback)

## Supported Target Resources

The target resource is used for NPC interaction zones (boss NPC, auto-sell NPC, supplier NPC). Both supported resources expose the same functionality; the client wraps the calls appropriately.

| Resource   | Config Value  | Notes                                   |
| ---------- | ------------- | --------------------------------------- |
| qb-target  | `'qb-target'` | Default fallback if neither is detected |
| ox\_target | `'ox_target'` | Uses `addLocalEntity` API               |

When `Config.TargetResource` is set to `'auto'`, the resource checks for `qb-target` first, then `ox_target`, and uses whichever is started.

## Pinning a Specific Resource

If auto-detection is picking up the wrong resource (for example, if you have both qb-target and ox\_target installed but want to use ox\_target), set the value explicitly:

```lua
Config.TargetResource = 'ox_target'
Config.InventoryResource = 'ox_inventory'
```

## Item Images Not Showing

If item images appear broken in the UI, check the following:

* Confirm `Config.InventoryResource` is set correctly or that auto-detection is picking the right resource (check with the console log on resource start).
* Confirm the item name in your items list matches the filename used by your inventory (e.g. `weapon_pistol` → `weapon_pistol.png`).
* If using a custom inventory, add its image path to `Config.ItemImagePaths` as shown above.
* Verify that the inventory resource is listed in the `files` block of its own `fxmanifest.lua` so NUI can access the images.


---

# 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://mohssins.gitbook.io/mohscriptsdocs/moh-businesssystem/compatibility.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.
