Looting System v3
This script is designed to enable players to loot specific props and entities in a GTA V FiveM server. It features a configurable loot system, item requirements, cooldowns, and random chance mechanics. The script supports both QBCore and ESX frameworks and includes options for customizable inventory image paths and target scripts.
How the script works
Player Interaction:
Players approach a lootable entity (e.g.,
prop_box_wood08a
orprop_rub_carwreck_2
).Using a keybind or interaction system, they trigger the looting process.
Item Requirements:
If
Config.lootTypeItemNeeded
specifies an item requirement for the loot type, the script checks the playerโs inventory.Example: A blowtorch is required to loot car wrecks.
Looting Process:
A progress bar animation (if enabled) is displayed during the looting process.
The script randomly selects items based on the
Config.LootRewards
and the probability (chance
) defined for each item.
Cooldowns:
Looted entities enter a cooldown period based on the
refreshTime
defined inConfig.LootRewards
.
Zones:
In
lootIncreaseZones
, players have a higher chance to receive additional loot.In
disableLootZones
, loot is disabled entirely.
Notifications:
Players are notified of the result (e.g., "You found nothing", "Search completed", "Inventory is full") using localized messages (
Config.Locales
).
Multiplayer Protection:
The script ensures only one player can loot an entity at a time using the
inProgressSearches
table. If a player disconnects, the script clears their progress to allow others to interact with the same entity.
Security Notice
This script is protected by FiveM's escrow system. The client and server-side code is encrypted and cannot be modified.
Last updated