This is a lightweight and modular bridge for FiveM that allows seamless switching between ox_target and qb-target.
- Automatically detects if
ox_targetorqb-targetis active - Unified functions for adding:
- Box Zones
- Target Models
- Target Entities
- Target Bones
- Target Player actions
- Fallback warnings in console if no target system is active
- Debug poly support
Some servers want to gradually migrate to ox_target without rewriting all their custom scripts. This bridge provides an abstraction layer, so your scripts remain agnostic of the target system used.
target_bridge/ βββ client/ β βββ test_target.lua # Sample usage (optional) βββ fxmanifest.lua βββ target_bridge.lua # Main logic βββ README.md
cfg ensure ox_lib ensure ox_target ensure target_bridge
lua TargetBridge.AddBoxZone(...) TargetBridge.AddTargetModel(...) TargetBridge.AddTargetEntityBridge(...) TargetBridge.AddTargetBone(...) TargetBridge.AddTargetPlayer(...)
In your fxmanifest.lua:
lua dependency 'target_bridge'
lua
CreateThread(function() TargetBridge.AddBoxZone("test_zone", vector3(437.39, -981.96, 30.69), 1.5, 1.5, { name = "test_zone", heading = 0, debugPoly = true, options = { { icon = "fas fa-eye", label = "Interaction Test", action = function() print("β Interaction successful!") end } } }) end)
Made with β€οΈ by TooMuchGood and GothamRP
MIT β Free to use and modify.