Synced Looting System with UI

Advanced Looting System

This system offers a dynamic looting experience where players can search objects like boxes and vehicles, each with unique loot tables and probabilities. Loot chances are balanced to never exceed 100%, adding an element of unpredictability. Configurable refresh timers allow customization of loot intervals globally or by type. The interactive grid-based NUI inventory enhances gameplay with custom sounds and realistic empty slots. A notification system provides animated success and error alerts, while customizable progress bars add immersive animations and labels for looting actions. Additionally, specific zones can disable looting or increase attempts for realism. The system is fully compatible with QBCore and ESX frameworks, ensuring seamless integration.


For further details, watch the Preview Video linked above!

PREVIEW WITH OLD UI
PREVIEW WITH NEW UI
https://www.hate-development.com/


# Looting v3 | 05.01.2025
- Cleared unused prints
- Changed to new ui.
- Fixed search sound is not stopping.
- Fixed some bugs ui related

# Looting v3 | 28.01.2025 
**ATTENTION** *This version is only for testing purposes, if you dont want to join testing dont update your resource.*
- Added **Config.PedDeleteTime** for deleting peds after looted.
- Removed all client side looting checks.
- **In this version multiple players can loot same object at the same time as you can see in the video [[needs testing]]**

# Looting v3 | 29.01.2025

* Fixed ped is not deleting [again]
* Fixed ui stucks after ped deleted.
* Improved event's safety.
# Looting v3 | 31.01.2025
**IMPORTANT** *This version is completely tested and finished, you can use that* **thanks @M4tta for testing**
* Server > qb and esx files are now opensource

https://medal.tv/games/gta-v/clips/jB5as4S3Emw12lD4H?invite=cr-MSwzN0UsMTU2MTgyNzY2LA

A B
Code is accessible No
Subscription-based No
Lines (approximately) 500+
Requirements qb-core or esx
Support Yes

3 Likes

Looting v3 | 29.01.2025

  • Fixed ped is not deleting [again]
  • Fixed ui stucks after ped deleted.
  • Improved event’s safety.

Looting v3 | 31.01.2025

IMPORTANT This version is completely tested and finished, you can use that thanks @M4tta for testing

  • Server > qb and esx files are now opensource

Seems like inspired from “Escape from Tarkov” and it looks amazing!

1 Like

Looting v3 | 13.03.2025

  • You can now disable zombie loot if you dont want it.
  • Chance factor is completely changed now it works as what it should be

Understanding the New Loot Chance System

Overview

The new loot chance system has been redesigned to provide a more intuitive and fair approach to item drops. Instead of using a cumulative probability approach, the system now uses a direct comparison method.

How It Works

  1. Random Roll : When loot is generated, the system rolls a random number between 1 and 100.

  2. Direct Chance Comparison : The system compares this roll against each item’s chance value.

  • If the roll is less than or equal to the item’s chance value, that item becomes eligible for selection.
  • For example, if an item has a 15% chance, rolling a 15 or lower will make it eligible.
  1. Group Selection : Multiple items with the same chance are grouped together.
  • If several items share the same chance value (e.g., three items with 15% chance), and that chance wins, one of those items will be randomly selected from the group.
  1. Highest Match Selection : If multiple chance groups are eligible (e.g., items with 20% chance and items with 15% chance), the system selects from the highest eligible chance value.
  • This ensures more rare items (lower chance values) aren’t overshadowed by common items.

Old System vs New System

Old System (Cumulative Chance)

In the previous system, chances were calculated cumulatively:

  1. The system would roll a number between 1-100.
  2. It would then check items sequentially, adding up their chances.
  3. When the cumulative total exceeded the roll, that item would be selected.

For example, with these items:

  • Item A: 20% chance
  • Item B: 30% chance
  • Item C: 15% chance
  • Item D: 35% chance

The system would check:

  • Roll ≤ 20: Select Item A
  • 20 < Roll ≤ 50: Select Item B (20+30)
  • 50 < Roll ≤ 65: Select Item C (20+30+15)
  • 65 < Roll ≤ 100: Select Item D (20+30+15+35)

This meant that the order of items in the loot table affected their actual chances.

New System (Direct Comparison)

The new system is more straightforward:

  1. Roll a number between 1-100.
  2. Group items by their chance values.
  3. Find the highest chance value that the roll is less than or equal to.
  4. Randomly select an item from that group.

This ensures that items have exactly their stated chance of being selected, regardless of their position in the loot table.

Example

Given the following loot table:

  • Item A: 20% chance
  • Item B: 20% chance
  • Item C: 15% chance
  • Item D: 10% chance
  • Item E: 5% chance

If the player rolls a 12:

  • Items A and B are eligible (20% > 12)
  • Item C is eligible (15% > 12)
  • Item D is not eligible (10% < 12)
  • Item E is not eligible (5% < 12)

The system will randomly select one item from the highest eligible chance group, which would be either Item A or Item B (both 20%). This system ensures that lower percentage items have their exact stated chance of being found, making rare loot truly rare and preserving the intended balance of the loot distribution.