# F.A.Q > Frequently asked questions for ML Bridge Category: BRIDGE · Source: https://miciomods.it/docs/ml-bridge-faq · Last updated: 2026-07-09 ## Setup **Why is the script not starting?** 1. Ensure `ox_lib` is started before `ml_bridge` in `server.cfg` 2. Verify `ml_bridge` folder exists in resources 3. Check console for dependency errors **Why does detection show "unknown" for my inventory?** 1. The inventory resource must be started before `ml_bridge` 2. Check that the resource name matches exactly (e.g. `ox_inventory`, not `ox-inventory`) 3. Set `Config.Debug = true` and check the detection log **How do I force a specific provider?** Set the corresponding config value instead of `'auto'`: **config.lua** ```lua Config.Inventory = 'ox' Config.Target = 'ox' Config.Fuel = 'LegacyFuel' ``` ## Framework **Which frameworks are supported?** QBCore, QBox (qbx_core), ESX, and Standalone. Detection is automatic based on which core resource is running. **Can I use ml_bridge without a framework?** Yes. Set `Config.Framework = 'auto'` or force `'standalone'`. Functions that require framework data (jobs, gangs, metadata) return default/nil values. **How does player data sync work?** On player load, `ml_bridge` caches identifiers (license, discord, steam), character ID, RP name, and job. This data is cached for instant access during logging without additional DB queries. ## Inventory **Which inventories are supported?** ox_inventory, qb-inventory, lj-inventory, ps-inventory, qs-inventory, codem-inventory, core_inventory, origen_inventory, tgiann-inventory. All are auto-detected. **How do I use Bridge.HasItem instead of direct exports?** Replace direct inventory calls with Bridge functions: ```lua -- Server local has = Bridge.HasItem(source, 'lockpick', 1) Bridge.RemoveItem(source, 'lockpick', 1) Bridge.GiveItem(source, 'bread', 5) -- Client local has = Bridge.HasItem('lockpick', 1) ``` **How does GiveItemToFit work?** It gives as many items as the player can carry using a binary search on `CanCarry`. Returns two values: ```lua local success, actualAmount = Bridge.GiveItemToFit(source, 'bread', 10) -- If inventory can only hold 7, actualAmount = 7 ``` ## Target **Which target systems are supported?** ox_target, qb-target, sleepless_interact. If none are found, falls back to text-based UI (`'textui'`). **How do I add a target to an entity?** ```lua Bridge.AddEntityTarget(entity, { label = 'Search', icon = 'fas fa-search', distance = 2.0, onSelect = function() print('Searched!') end }) ``` ## Logging **How does multi-provider logging work?** `Bridge.Log` checks `Config.LogProvider` and sends to one or more backends: - `'discord'`: Discord webhook embeds - `'ox_lib'`: ox_lib logger - `'fivemanage'`: FiveManage HTTP API - `'both'`: Discord + FiveManage - `'all'`: All three Logs are batched and sent every 60 seconds to avoid rate limits. **How do I disable a specific log?** In any ML script's config, set the webhook to `false`: ```lua Config.Log = { AdminRevive = 'https://discord.com/api/webhooks/...', PlayerDeath = false, -- disabled } ``` ## Dispatch **Which dispatch systems are supported?** ps-dispatch, cd_dispatch, qs-dispatch, op-dispatch, rcore_dispatch, origen_police, bub-mdt, lb-dispatch, wasabi_mdt, tk_dispatch, fd_dispatch, emergencydispatch. If none are detected, `ml_bridge` provides its own fallback system that creates a timed map blip (2 min) and shows a phone-style notification. **How do I send a dispatch alert?** ```lua Bridge.AlertDispatch({ message = 'Store Robbery', description = 'Armed robbery in progress', coords = GetEntityCoords(cache.ped), jobs = { 'police' }, code = '10-31', blip = { sprite = 58, scale = 1.0, color = 1, flash = true }, }) ``` ## Minigames **What minigames are available?** Three types: - **KeySequence**: Press random keys in order. Supports a hidden mode where upcoming keys are scrambled - **HoldKeySequence**: Multiple rows of keys that must be held for a duration. Supports parallel rows - **ProgressBar3D**: A 3D world-space progress bar with fade in/out All three render in 3D at world coordinates, not in screen space. ## Callbacks **How do client-server callbacks work?** Server registers a named handler with `Bridge.OnServerRequest`. Client calls `Bridge.RequestServer` which yields the coroutine until the server responds (10s timeout). The `secure` flag prevents other resources from invoking a callback registered by your script. ```lua -- Server Bridge.OnServerRequest('myData', function(src, key) return MySQL.query.await('SELECT ...', { key }) end, true) -- Client (inside CreateThread) local result = Bridge.RequestServer('myData', 'someKey') ``` ## Spatial **What is the Spatial utility?** `Spatial` is a client-side sector-based proximity system. It divides the map into 200m sectors and only checks nodes in the player's current sector, making it efficient for tracking many points simultaneously. Use `Spatial.Track(id, coords, distance, onEnter, onExit)` to register a point. The loop starts automatically. ## Waypoints **What is DUI pooling?** DUI (Direct UI) textures are rendered directly into the 3D world. Pooling means DUI instances are created once and reused. When a waypoint goes offscreen, its DUI is returned to the pool. When a new waypoint needs rendering, it grabs an existing DUI from the pool instead of creating a new one. This keeps GPU memory constant. **Do waypoints affect performance?** Minimal impact. Only waypoints visible on screen acquire a DUI. Offscreen waypoints cost zero. Visibility checks run every 100ms. The DUI pool prevents texture creation and destruction overhead. **Can I create waypoints from the server?** Yes. Server exports send waypoint data to specific players, groups, or all players: ```lua -- For one player exports.ml_bridge:WaypointCreate(source, data) -- For everyone exports.ml_bridge:WaypointCreate(-1, data) ``` ## Updates **How do I update the script?** 1. Download latest from CFX Portal 2. Backup `config.lua` and `config_server.lua` 3. Replace all files except config 4. Restart the resource No database, no migration needed.