Configuration
Every config.lua option for tDetector, with its type, default and effect.
Everything here lives in config.lua, read at resource start. Run
restart tDetector after editing.
Speed unit, sensitivity, layout and HUD position are not here: players set those in
/tdetector, and they persist in KVP.
Radar sources
| Option | Type | Default | Description |
|---|---|---|---|
Config.radarResources | table | { "tRadar", "wk_wars2x", "seeker_dual", "rs9000", "ProLaser4" } | Radars that can set the detector off, probed in order; first transmitting wins, one not running is skipped. Bare name or table — see the entry shapes. |
Config.radarStateInterval | number (ms) | 500 | How often a client re-reads its own radar. Also the shortest instant-on burst that can be caught. |
Range
| Option | Type | Default | Description |
|---|---|---|---|
Config.detectionRange | number (m) | 500.0 | Fallback reach for a radar not reporting its own. The Ka figure; other bands scale off it. |
Config.detectionRatio | number | 2.0 | A radar reporting its own range is heard out to that × this. 0 returns every radar to the flat range. |
Config.detectionRangeMax | number (m) | 1000.0 | Ceiling on one source's reach, whatever a radar reports. |
Config.screenRange | number (m) | 8.0 | How near before another vehicle's detector is drawn on the prop's glass. Your own vehicle is exempt. |
Config.audioRange | number (m) | 28.0 | How far the detector is heard from outside the car. Must exceed screenRange; tLib caps it at 250 m. |
Raise detectionRange a long way and one officer with a radar on makes every detector on
the map alert permanently.
Sensitivity and bands
| Option | Type | Default | Description |
|---|---|---|---|
Config.sensitivity.highway | number | 1.00 | Highway reach, as a fraction of detectionRange. |
Config.sensitivity.city | number | 0.45 | City reach. Not applied to Ka or lidar. |
Config.autoSensitivityAbove | number (MPH) | 45 | In Auto, the speed at which Highway takes over. Always MPH. |
Config.bandRange.ka | number | 1.00 | Ka reach, as a multiple of detectionRange. |
Config.bandRange.k | number | 0.85 | K reach. Carries least. |
Config.bandRange.x | number | 1.25 | X reach. Carries furthest. |
Config.bandRange.laser | number | 1.00 | Lidar reach. |
bandRange composes with sensitivity rather than replacing it, so City reduces X and K
on top of the band multiples.
False alerts
| Option | Type | Default | Description |
|---|---|---|---|
Config.falseAlerts.enabled | boolean | true | false makes the detector mean police radar and nothing else. |
Config.falseAlerts.siteRange | number (m) | 120.0 | How far a door opener carries. Independent of detectionRange. |
Config.falseAlerts.kShare | number | 0.30 | Fraction of doorways on K instead of X. Stable per site. |
Config.falseAlerts.sites | table | 25 entries | {x, y, z} per fixed emitter — real vanilla doorways from the game's map files. Replace wholesale for a custom map. |
Config.falseAlerts.traffic.enabled | boolean | true | Blind-spot radar in surrounding traffic. |
Config.falseAlerts.traffic.range | number (m) | 60.0 | How far a blind-spot antenna looks at the next lane. |
Config.falseAlerts.traffic.share | number | 0.35 | Fraction of vehicle models fitted, from the model hash — so the same car always falses and another never does. |
GPS lockouts
| Option | Type | Default | Description |
|---|---|---|---|
Config.lockouts.enabled | boolean | true | Whether MARK can store a lockout at all. |
Config.lockouts.radius | number (m) | 60.0 | How close counts as being at a stored lockout. |
Config.lockouts.autoLearn | number | 3 | Drive-bys before a site locks itself out. 0 disables AutoLearn; MARK still works. |
Config.lockouts.max | number | 100 | Cap on stored lockouts. Oldest dropped first. |
Config.lockouts.trafficDismissMs | number (ms) | 60000 | How long MARK silences a car. |
Lockouts are per client in KVP, so one player's MARK never quietens another's detector.
Alerting
| Option | Type | Default | Description |
|---|---|---|---|
Config.instantHoldMs | number (ms) | 3000 | How long an instant-on alert stays up after the radar keys off. Constant-on alerts are never held. |
Config.autoMuteBelow | number (MPH) | 20 | Mute the tone below this speed; the display keeps working. 0 disables. Always MPH. |
Config.speedUnit | string | "mph" | A new player's unit: "mph" or "kmh". Anything else, "kph" included, is a startup error. A player's own pick persists in KVP. |
The 3D detector prop
The box on the windshield, visible to everyone in and around the car.
| Option | Type | Default | Description |
|---|---|---|---|
Config.vehicleProp.models | table | the built-in alone | Archetypes offered, as { model, label }. rdx4000 is always available and always first; adding one means streaming its .ydr/.ytyp from your own resource. |
Config.vehicleProp.default | string | "rdx4000" | Which archetype a vehicle that names none gets. |
Config.vehicleProp.placements | table | empty | Where it sits, keyed by vehicle spawn name: { x, y, z, rx, ry, rz } offsets from the vehicle origin, exactly as AttachEntityToEntity takes them. An optional model overrides the archetype. |
A vehicle with no entry here and none saved in game gets no prop, and a car with no
prop relays nothing to its passengers. /tdetectoredit is the easier route: in-game
placements live in data.json and win over this table.
Access control
Two separate questions.
Who may use tDetector
| Option | Type | Default | Description |
|---|---|---|---|
Config.access | table | { mode = "everyone" } | The gate. mode is "everyone", "ace", "job", "item" or "custom" — or a list, which passes if any does. |
Config.access = {
mode = "everyone", -- everyone | ace | job | item | custom
ace = "tdetector.use", -- mode "ace"
job = { police = 0, mechanic = 2 }, -- mode "job": MINIMUM grade
item = "radardetector", -- mode "item"
count = 1, -- how many of `item`; default 1
custom = function(src) return false end, -- mode "custom"
}This is tLib's access module — frameworks, inventories and detection order are its
documentation. A gate whose dependency is absent
denies everyone and says so.
A player who does not pass cannot open /tdetector and is sent no radar data at all,
both checked server-side on every request.
Who flips the switch
| Option | Type | Default | Description |
|---|---|---|---|
Config.toggleRequiresItem | boolean | false | The QBCore item is the only on/off switch. /tdetector still opens; only the toggle is disabled. |
Config.useAsItem | boolean | false | Run the item alongside an active /tdetector toggle. Not needed when toggleRequiresItem is on. |
Config.qbItemName | string | "radardetector" | Must match your qb-core/shared/items.lua entry. |
The toggle being greyed out is not the lock: the server also refuses to send radar data to a player not holding the item.
Wiring the QBCore item
Add the item to qb-core/shared/items.lua, drop radardetector.png into
qb-inventory/html/images/, and restart tDetector. Using the item in a vehicle toggles
the detector, identically to the /tdetector button.
['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.',
},Without qb-core running, tDetector prints this and carries on:
[tDetector] Config.useAsItem is on, so the "radardetector" item is wired to the detector -- but qb-core is not running, so the item does nothing.
A missing or wrong setting
Nothing silently reverts. A scalar setting that is deleted, mistyped or unusable is
replaced by its shipped default — all of them in TDET_DEFAULTS at the bottom of
config.lua — and warned about once, naming the key, what was found and the line to
paste back. Table-valued settings degrade per field, so deleting
Config.bandRange.x leaves the other three bands untouched.
Next steps
- Integrating any radar — the per-entry shapes for
Config.radarResources. - Usage — what these values look like on the glass.
Radar Detector
Still stuck? Support can answer it directly.
Was this page helpful?
TIMMYG Studios