Mods & customization Guide

qb-target FiveM: setup and a Lua zone example

Check qb-target dependencies, create a small box-zone interaction, clean it up on stop, and separate client visibility from server permission checks.

Original Magnate concept artwork; not a GTA VI screenshot Original concept artwork · Not game footage

Check the dependency and target type

The reviewed qb-target README names PolyZone as a dependency and QBCore as optional. This does not mean every framework-related filter works without an integration. Match the feature you use to the installed framework and resource revision.

The source reviewed here is revision a3ea78b. Its exports distinguish box and circle zones from entity, model and bone interactions. Choose the smallest scope that matches the intended interaction. A model-wide option is different from a single location’s reception desk.

Keep the resource names and dependency order consistent with their manifests. For a separate Lua consumer resource, declare qb-target as a dependency and load your client script there. Use a staging resource with unique zone and command names for the following diagnostic.

Create one box zone at your current location

Place this example in your staging resource’s client.lua. With qb-target started, run magnate_qbzone in F8 while standing at an open test location, then step away and target the box. Use your actual target binding. Selecting the option prints a local diagnostic message; it does not modify inventory, money or jobs.

The example removes its previous named zone before creating another and removes it when the consumer resource stops. If qb-target itself restarts, run the diagnostic again. Magnate has reviewed the documented API and source but has not executed the example in FiveM.

client.lua — staging-only local interaction
local zoneName = 'magnate_qbtarget_check'

RegisterCommand('magnate_qbzone', function()
    local position = GetEntityCoords(PlayerPedId())
    exports['qb-target']:RemoveZone(zoneName)
    exports['qb-target']:AddBoxZone(zoneName, position, 1.5, 1.5, {
        name = zoneName,
        heading = 0.0,
        debugPoly = true,
        minZ = position.z - 1.0,
        maxZ = position.z + 1.0
    }, {
        options = {
            {
                icon = 'fas fa-check',
                label = 'Check local action',
                action = function()
                    print('Magnate: qb-target action selected.')
                end
            }
        },
        distance = 2.0
    })
end, false)

AddEventHandler('onClientResourceStop', function(resourceName)
    if resourceName ~= GetCurrentResourceName() then return end
    if GetResourceState('qb-target') == 'started' then
        exports['qb-target']:RemoveZone(zoneName)
    end
end)

Zone geometry, option visibility and the callback are separate

First confirm that the debug box occupies the intended space. Then check distance and option conditions. Finally select the item and observe the local message. An option missing from the menu, a misplaced box and a callback that fails are different symptoms.

The documented options include action, event routing, canInteract and framework-related filters. In the reviewed client source, action is selected before event routing when both are supplied. Keep the diagnostic to one action path; mixing callbacks and events makes the expected behavior harder to identify.

After the static test succeeds, add one condition or integration at a time. For an entity-specific interaction, use the matching entity API instead of treating a box-zone name as an entity identifier.

Do not treat a hidden client option as authorization

A job filter or canInteract function can control the interface the client displays. For a server-side purchase, storage operation or restricted job action, validate the player and requested operation on the server. Cfx security guidance explains why client-triggered events cannot be trusted merely because your UI normally hides the action.

Test an allowed player and a disallowed player against the actual resulting state. A successful print from this local example proves only that the selected callback ran. It does not establish permission handling, inventory delivery or a saved transaction.

Migrating between qb-target and Ox Target needs an API review

Both resources provide interaction systems, but a renamed export is not a migration plan. Our Ox Target guide uses that resource’s documented model/entity/zone APIs and option fields; this guide uses qb-target exports and option structures. Inventory every registration and removal path before replacing the backend.

For each consumer, record the target scope, label, selected action, visibility rules and cleanup behavior. Convert one interaction on staging and compare its behavior before migrating the next. Do not use a working resource start as evidence that all registrations and framework filters survived.

Suggested interaction migration record
RecordQuestionProof to collect
ScopeZone, entity, model or bone?The intended objects expose the option
GeometryWhere is the interaction volume?Debug view and approach tests
VisibilityWho should see it and when?Allowed and disallowed player results
ActionWhich callback or event should run?Observed callback and gameplay result
CleanupWhat removes the registration?Stop/restart without stale duplicates

Troubleshoot a small reproduction before the full resource

If the export is missing, inspect the resource name, startup errors and installed revision. If the box exists but an option is missing, compare the configured distance, height range and conditions. If an option appears but gameplay fails, follow the selected callback or event into the consumer resource.

Keep the exact error and versions with the reproduction. Remove the staging diagnostic when finished, then retest the production interaction using ordinary players. This is documentation-based guidance for GTA V FiveM resources, not a compatibility claim for GTA VI.

Questions, answered.

Does qb-target require QBCore for every use?

The reviewed README lists QBCore as optional and PolyZone as required. Framework-dependent features still need their intended integration.

What if I define both action and event?

The reviewed client source checks action first. Use one intended action path and verify the behavior in your installed revision.

Does canInteract secure a server event?

No. Keep the server-side permission and state validation independent from the client option visibility.

Sources & editorial notes

Source review: November 7, 2026. Platform announcements can change. This guide separates published facts from Magnate’s original analysis and preparation advice.

  1. QBCore — reviewed qb-target README Pinned dependency and feature scope.
  2. QBCore — qb-target API documentation Documented zone parameters and option fields.
  3. QBCore — qb-target registration source Pinned AddBoxZone and RemoveZone implementations.
  4. QBCore — qb-target client source Pinned selected action and event routing.
  5. Cfx — Secure your events Server-side validation of client-triggered actions.

Published by an independent editorial brand. Read our editorial standards.

Find your next move

Search the Magnate guide library.

Browse every guide