Installation

How to install tDetector on your FiveM server.

Setup

Prerequisites

  • FiveM server with OneSync enabled (Infinity or Legacy)
  • tLib — provides settings persistence, move mode, dialog system, and layout discovery
  • Wraith ARS 2X (wk_wars2x) — tDetector reads whether a player's radar antenna is active via its export. Without it no detection occurs, but the script loads cleanly.

Install

Extract the resource

Drop the tDetector folder into your resources directory (e.g., alongside other [tScripts]).

Patch Wraith ARS 2X

tDetector reads radar-gun state through an export that isn't in Wraith by default. Add it once to your wk_wars2x install:

wk_wars2x/fxmanifest.lua — add one line:

client_export "DetectorExport"

wk_wars2x/cl_radar.lua — add anywhere at the top level:

function DetectorExport()
    return RADAR
end

Required for detection to work

Without this export tDetector loads cleanly but cannot detect any active radar guns. The export is read-only and does not change Wraith's behavior.

Add to server.cfg

Order matters — tLib must start before tDetector, and wk_wars2x should be running for detection to work.

server.cfg
ensure tLib
ensure wk_wars2x
ensure tDetector

Start the server

No further setup is required. Per-player settings (speed unit, layout, HUD position) are stored in KVP. The server creates data.json automatically on first start to store the sound configuration.


Configuration

Open shared/config.lua to change the resource name, default speed unit, or enable QBCore item support:

shared/config.lua
Config = {}

-- Name of the Wraith ARS 2X resource
Config.wraithResourceName = "wk_wars2x"

-- Default speed unit: 'mph' or 'kph'
-- Players can override this per-session from /tDet
Config.speedUnit = "mph"

-- QBCore item support (optional)
-- Set useAsItem to true and ensure qb-core is running to allow the detector to be used as a QB item.
Config.useAsItem  = false
Config.qbItemName = "radardetector"

No config.lua restart needed for per-player settings

Speed unit, layout choice, and HUD position are all saved in player KVP via /tDet. You only need to edit shared/config.lua to change the server-wide default or point at a different radar resource.


QBCore item support (optional)

tDetector can be triggered as a useable inventory item instead of (or alongside) the /tDet toggle button.

Enable item usage

In shared/config.lua set:

Config.useAsItem  = true
Config.qbItemName = "radardetector"  -- must match your items.lua entry

Add the item to QB shared items

In qb-core/shared/items.lua:

['radardetector'] = {
  ['name']        = 'radardetector',
  ['label']       = 'Radar Detector',
  ['weight']      = 3000,
  ['type']        = 'item',
  ['image']       = 'radardetector.png',
  ['unique']      = true,
  ['useable']     = true,
  ['shouldClose'] = true,
  ['combinable']  = nil,
  ['description'] = 'We are not liable for your reckless driving.',
},

Add the inventory image

Drop radardetector.png into qb-inventory/html/images/.

Restart

restart tDetector

Using the item while in a vehicle toggles the detector on or off — identical to pressing the button in /tDet.


File layout

fxmanifest.lua
data.json
cl_hud.lua
cl_detector.lua
cl_settings.lua
ui.html
PathPurpose
data.jsonAuto-created on first start — stores sound key→file mappings and installed sounds
shared/config.luaRadar resource name, default speed unit, QB item config
server/sv_admin.luaLayout discovery, marketplace registration, sounds config persistence
server/sv_sync.luaBroadcasts active radar-gun list to all clients every second
server/sv_item.luaQBCore useable item handler (only runs when Config.useAsItem = true)
client/cl_hud.luaNUI toggle, move mode, layout switching, KVP persistence
client/cl_detector.luaDetection loop — finds the closest active radar gun each tick
client/cl_settings.lua/tDet settings dialog
client/ui/Built NUI assets (do not edit)
client/web/NUI source (SolidJS — build with bun run build)
layouts/HUD layout skins (auto-discovered)

Do not edit client/ui/

These are built NUI assets. The source lives in client/web/. To rebuild after modifying the SolidJS source, run bun run build from inside client/web/.

On this page

Need help?

Ask on Discord