Skip to content

mur4i/t_lootzones

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QB-Core/Qbox Loot Zones

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.


https://streamable.com/jz5of7

📌 Features

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.


🛠️ Installation

1️⃣ Dependencies

Ensure you have the following resources installed:

2️⃣ Download & Install

  1. Clone or download this repository and place it inside your resources folder.
  2. Add the following line to your server.cfg:
    ensure t_lootzones

3️⃣ Configuration

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

🔧 How It Works

  1. When the resource starts, loot props spawn inside the configured zones.
  2. Players can search a loot prop via ox_target.
  3. A random item from the loot table is given to the player.
  4. The loot prop disappears and will respawn after the cooldown.

📜 Commands & Events

Events

  • t_lootzones:giveLoot (tier): Server-side event to give a player a random item from the loot table.

⚠️ Troubleshooting

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.


📜 License

This project is open-source and free to use under the MIT License. Contributions are welcome!


🚀 Enjoy Looting! 🎁

About

Loot zones script for qbox/qbcore

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%