# 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, HUD, police alert, and vehicle keys: `modules/utils/client.lua`
* Weather sync: `modules/weather/client.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

Basic 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`

If you use another target resource, replace the add/remove zone logic here.

## Notify, Text UI, HUD, Police Alert, Vehicle Keys

File: `modules/utils/client.lua`

This is the main file for simple custom integrations.

Common changes:

* Replace `lib.notify`
* Replace `lib.showTextUI` and `lib.hideTextUI`
* Replace `0r-hud-v3` hide/show export
* Add your own police alert event
* Add your own vehicle key export

Notify example:

```lua
function Utils.notify(title, type, duration, description)
    exports["my_notify"]:Send({
        title = title,
        description = description,
        type = type,
        duration = duration
    })
end
```

## Weather Sync

File: `modules/weather/client.lua`

Default support:

* `qb-weathersync`
* `vSync`

If you use another weather script, replace `disableSync()` and `enableSync()` in this file.

## Framework Integration

Files:

* `modules/bridge/esx/*`
* `modules/bridge/qb/*`
* `modules/bridge/qbx/*`

The script auto-detects framework name in `shared/init.lua`.

If your server uses a heavily customized framework, this is where you adapt player loaded events and framework object access.

## Safest Way To Integrate

Use this order:

1. Keep the same function names and return values.
2. Replace only the framework or export specific lines.
3. Test warehouse purchase, raw materials, sale mission, and money washing after every change.
