A FiveM script for QB-Core & Qbox that spawns lootable props in designated zones. Players can search these props to receive a random item based on loot tier probabilities. The loot props automatically respawn after a cooldown period.
✅ Loot Zones: Different zones with configurable loot tiers (low, medium, high).
✅ Random Loot: Players receive one random item from the tier-based loot table.
✅ Prop Interaction: Uses ox_target for searching loot props.
✅ Cooldown System: Lootable props respawn after a configurable time.
Ensure you have the following resources installed:
- Clone or download this repository and place it inside your
resources
folder. - Add the following line to your server.cfg:
ensure t_lootzones
Modify config.lua
to customize loot zones, props, loot tables, and respawn cooldown:
Config.LootZones = {
{ tier = "low", coords = vector3(124.81, -1071.83, 29.19), radius = 10.0 },
{ tier = "medium", coords = vector3(73.13, -1054.94, 29.42), radius = 20.0 },
{ tier = "high", coords = vector3(70.33, -1139.59, 29.27), radius = 30.0 },
}
Config.LootTables = {
low = { { item = "water", min = 1, max = 3 }, { item = "bread", min = 1, max = 2 } },
medium = { { item = "ammo-9", min = 1, max = 30 }, { item = "cash", min = 10, max = 100 } },
high = { { item = "weapon_pistol", min = 1, max = 1 }, { item = "cash", min = 10, max = 100 } },
}
Config.RespawnCooldown = 300 -- Time in seconds
- When the resource starts, loot props spawn inside the configured zones.
- Players can search a loot prop via ox_target.
- A random item from the loot table is given to the player.
- The loot prop disappears and will respawn after the cooldown.
t_lootzones:giveLoot (tier)
: Server-side event to give a player a random item from the loot table.
❓ Loot doesn’t spawn?
➡️ Ensure config.lua
is properly loaded and that your zones are configured correctly.
❓ Props don’t respawn?
➡️ Double-check the respawn function and ensure Config.RespawnCooldown
is set correctly.
This project is open-source and free to use under the MIT License. Contributions are welcome!