# F.A.Q > Frequently asked questions for ML Trap Category: TRAP · Source: https://miciomods.it/docs/ml-trap-faq · Last updated: 2026-07-17 ## Setup **Do I need a database?** Traps are saved to the `ml_traps` table so they survive restarts, which needs oxmysql. To run without a database, set: **shared/config.lua** ```lua Config.Persistence = { enabled = false } ``` **How do I change the language?** Set the language code. Translation files live in `locales/`. **shared/config.lua** ```lua Config.locale = 'en' ``` **Can I use a key press instead of a target?** Yes. Switch the interaction method: **shared/config.lua** ```lua Config.InteractionMethod = 'textui' ``` ## Traps and Cages **What is the difference between a snap trap and a cage trap?** A snap trap sits on the ground. Animals walk up, feed on the bait, then wander off. It does not hold anything. A cage trap closes a door on whatever enters its radius and holds it alive, ready to be killed, released or picked up. **Can a cage capture other players?** Not by default. Turn it on with: **shared/config.lua** ```lua Config.AllowPlayerCapture = true ``` Only cage types flagged `capturesPlayers` trap players, and the shipped Large Cage is the one that has it. A non-owner who steps into the baited cage springs it shut on themselves, and the owner or an admin can close it on a player standing inside. The captive cannot open the cage and is auto-released after `Config.MaxPlayerCaptureSeconds`. **Which animals does each bait attract?** Each bait lists the ped models it lures, set per trap type: **shared/config.lua** ```lua ['meat_bait'] = { animals = { 'a_c_mtlion', 'a_c_coyote', 'a_c_boar' }, } ``` A cage with `Config.CageCatchAll = true` also catches any animal or NPC that physically enters the cage, regardless of the bait list. Players are never caught this way, that is what `Config.AllowPlayerCapture` controls. **How many animals can one trap lure at once?** One. The trap walks the nearest matching animal in and leaves the rest alone until it is free again. This also holds with the ambient spawner on. **My server has no wild animals. Do traps still work?** Yes. Turn on the ambient spawner: **shared/config.lua** ```lua Config.AmbientSpawn = { enabled = true } ``` A baited trap with no animal to lure asks the server to spawn one in the distance, synced for every player, and it wanders in on its own. One animal per trap at a time, with a per-trap timer between spawns. **How do I kill a captured animal?** Hold a melee weapon from `Config.KillWeapons` and use the Kill option in the panel. The server checks the held weapon before allowing the kill. The animal drops where it stands and leaves a carcass on the ground to loot. **Does killing a captured animal give loot?** Not out of the box. Set `enabled = true` in `Config.KillLoot`, then tune the per-animal lists: **shared/config.lua** ```lua ['a_c_boar'] = { { item = 'meat', min = 2, max = 4, chance = 100 }, { item = 'hide', min = 1, max = 1, chance = 50 }, }, ``` Each entry rolls its own chance and amount, and the items go to the killer, or on the ground when the inventory is full. The item names must exist in your inventory. Leave the table off to keep rewards in `open/server.lua`. **Can other players take my trap or my catch?** Not while these stay on, which is the default: **shared/config.lua** ```lua Config.OwnerOnlyPickup = true Config.OwnerOnlyCage = true ``` `OwnerOnlyPickup` blocks anyone but the owner or an admin from picking the trap up. `OwnerOnlyCage` blocks them from opening the cage or killing the captive. ## Durability **How does durability work?** A trap with a `durability` value drains hours of active use while it is baited or holding a capture. At zero it breaks: the bait is lost, any captive is released, and it cannot be used again until repaired with the configured materials. **How do I make a trap last forever?** Remove the `durability` and `RepairItems` fields from that trap type. The wear system and the repair tab disappear for it. ## Persistence **Do traps survive a restart?** Yes, by default. Both snap and cage traps ship persistent, so they reload where you left them. The `persistent` field on each trap type controls this: set it to false to keep that type in memory only. **Why did an old trap disappear on its own?** The cleanup pass removes persistent traps that have not been used for `Config.Cleanup.inactiveDays`. Raise the value or disable it: **shared/config.lua** ```lua Config.Cleanup = { enabled = false } ``` ## Updates **How do I update the script?** 1. Download latest from CFX Portal 2. Backup config files 3. Replace all files except config 4. Restart the resource Traps in the `ml_traps` table are preserved. If you rename any trap or bait item key, update the matching `trap_type` and `bait_type` values in that table.