# F.A.Q > Frequently asked questions for ML Turret Category: TURRET · Source: https://miciomods.it/docs/ml-turret-faq · Last updated: 2026-07-09 ## Setup **Do I need to import any SQL file?** No. The `ml_turrets` table is created automatically at first start through `CREATE TABLE IF NOT EXISTS`. Subsequent restarts are a no-op. **Why do I get "Schema install failed" on boot?** `oxmysql` cannot reach your database. Check the connection string in your server config. The script refuses to start until the DB is reachable, no silent fallback. **The kit item does nothing when I use it.** The item is not registered in your inventory, or the `item` field on the turret type does not match the inventory item name. Verify both sides. The item name on the type must be the exact key used by your inventory definition. ## Placement **The placement ghost only shows the base, not the full turret.** Your Bazq stream resource is not loaded or starts after `ml_turret`. Move it above in `server.cfg`. The ghost reads the same props the live turret uses, so if streaming fails only the base is created. **How do I block placement in specific areas?** Use `Config.NoPlaceZones`. The ghost turns red inside these zones and cannot be confirmed. Three shape types supported: `sphere`, `box`, `poly`. **shared/config.lua** ```lua Config.NoPlaceZones = { { type = 'sphere', coords = vec3(298.6, -584.8, 43.3), radius = 80.0 }, } ``` **Can I change the placement animation?** Yes, via `Config.PlacementProgress.anim`. Any valid animation dict + clip works. The config comment lists four useful presets (hammering, rummaging, inspecting, repairing). ## Ownership and Invites **Someone who is NOT the owner can still see the Manage option.** Check the `permissions.canBeUsedByAll` flag on the turret type. If `true`, anyone in range can use the turret. If `false`, the option only appears to the owner and group members. The ox_target `canInteract` callback evaluates this on every aim, so changes take effect immediately. **Two players on the same FiveM account show as the same person.** Set `Config.Ownership.playerNameFormat = 'rp_full'`. License2 alone does not distinguish characters on the same account, `ml_turret` falls back to citizenid on QBCore/Qbox for ownership checks. On ESX/standalone, license is used. **How long does an invite stay pending?** 30 seconds by default. Configurable via `Config.Ownership.inviteTimeoutSeconds`. **Can a group member invite other members?** No. Only the owner can invite or revoke members. Group members can open the panel, reload, repair and refuel but cannot transfer ownership or dismantle. ## Combat and Damage **Why does my weapon do no damage to the turret?** The weapon must be in the turret's `weaponDamage` table. It is a strict whitelist: unknown weapons are blocked as potential forge attempts. Add the weapon hash with an absolute HP value: **shared/config.lua** ```lua weaponDamage = { [`WEAPON_YOUR_WEAPON`] = 25, } ``` **How do I make a turret invincible?** Set `infiniteHealth = true` on the turret type (applies to every instance) or on a specific `Config.FixedTurrets` entry (per-instance). The damage pipeline short-circuits server-side. **My AI turret spins wildly when a target gets too close.** Increase `rotation.aimDeadZone` (metres). When the target is inside this horizontal distance the turret freezes yaw instead of flipping. Default is 1.2m for `bazq_heavy`, 0.8m for `cctv_sentry`. **The turret switches targets too fast.** Increase `targeting.switchCooldown` (ms) on the type, or `Config.AI.defaultSwitchCooldown` for a global override. Default is 800ms, the turret will not adopt a new target until that much time has passed since the last swap. ## Destruction and Repair **How do I repair a damaged turret?** Open the panel via target → Repair tab → select a repair item. Each repair item has an `addHealth` value configured in the turret type: **shared/config.lua** ```lua repairItems = { ['repair_kit'] = { addHealth = 300.0 }, ['welding_torch'] = { addHealth = 150.0 }, } ``` **How do I rebuild a destroyed turret from rubble?** Target the rubble prop → Repair Rubble → consumes one `Config.Destruction.destructionRepairItem` (default `turret_rebuild_kit`) and brings the turret back at 50% HP. **Can I make a type impossible to rebuild?** Yes, two options. Per type, set `canBeRepairedAfterDestruction = false`: rubble still spawns but the Repair option is hidden (dismantle-only for salvage). Per type, set `permanentDestruction = true`: death is final: no rubble, no repair, DB row deleted instantly, player quota freed up immediately. **A fixed turret was destroyed and I want it to stay dead until an admin revives it.** Set `stayDestroyed = true` on the instance in `Config.FixedTurrets`. When destroyed, the DB row keeps `is_destroyed = 1` across restarts. To bring it back, run `/turret_revive ` as an admin, then restart the resource. **The rubble prop is the wrong shape for my map aesthetic.** Change `destroyedProp` on the type. Valid GTA props include `prop_rub_scrap_02`, `prop_rub_scrap_04`, `prop_rub_generator`, `prop_rub_boxpile_05`, `prop_dumpster_02a`. Set `nil` to skip the rubble entirely (explosion only). ## AI Behaviour **How do I disable AI entirely?** Set `Config.AI.enabled = false`. Every turret becomes manual-only. **How do I restrict AI to zombies only?** Set `targeting.targetPlayers = false`, `targetHumans = false`, `targetZombies = true` on the turret type. For `Config.HRS`, either patch `hrs_zombies` to set the `hrsIsZombie` state bag, or add your zombie models to the `zombieModels` whitelist. **Who can toggle the AI on/off from the panel?** The owner and group members by default. For fixed turrets, configure `ai.toggleableBy` with a policy table: **shared/config.lua** ```lua ai = { enabled = true, toggleableBy = { jobs = { 'police' }, aces = { 'command.turret' } }, } ``` ## Networking and Performance **Why does Player 2 see the turret stutter while Player 1 sees it smooth?** The turret's gunner and barrel are client-side-only props, each client spawns and animates its own local copies attached to the networked base. Every player sees 60fps rotation regardless of network ownership or distance. **How much server load does one turret generate?** One networked entity (the base) and a batch DB save every 60 seconds if the turret's state has changed. Fire events, muzzle flashes and damage reports are scope-limited to clients within 150m. AI logic runs entirely on clients. ## Updates **How do I update the script?** 1. Download latest from CFX Portal 2. Backup your `shared/config.lua`, `server/config_server.lua`, `locales/*.lua` and any edits in `open/*.lua` 3. Replace all other files 4. Restart the resource No DB migration is required. New columns are added via `CREATE TABLE IF NOT EXISTS` safely, existing rows keep their data.