FiveM Loot Bag Script
- This script creates loot bags containing a player’s inventory when they die. Other players can interact with the bag and the loot can be taken one item at a time or all at once. The script supports configurable options like restricting loot to the bag owner or allowing anyone to loot, customizing death events, and zones where only the owner can loot.
Features
-
Creates a loot bag when a player dies, containing all their inventory items.
-
Allows players to interact with the bag via
ox_target
and loot items usingox_lib
. -
Option to loot items one by one without or All at ones.
-
Configurable zones where only the player who died can loot the bag.
-
Configurable despawn time for the loot bag.
Dependencies
-
ESX
-
ox_target
-
ox_lib
-
ox_inventory
Config
Config = {}
Config.Core = 'ESX'
Config.CoreGetCoreObject = 'es_extended'
Config.Target_script = 'ox_target'
Config.Menu_script = 'ox_lib'
Config.DeathEvent = 'esx:onPlayerDeath' -- Death Event here
Config.icon_path = 'nui://ox_inventory/web/images/' -- Inventory icon path
Config.Print = true -- true or false for debugging prints
Config.LootBagModel = "prop_cs_heist_bag_02" -- Loot bag prop model
Config.LootBagDespawnTime = 300000 -- Despawn time in ms (5 minutes)
Config.label = 'Search Bag' -- Target label for interaction
Config.InteractionDistance = 2.5 -- Interaction distance for ox_target
Config.RemoveBagAfterLooted = true -- Remove the bag after it's emptied
Config.OnlyOwner = false -- If true, only the owner can loot; if false, anyone can loot the bag
Config.OwnerZones = {--only the owner can loot in the zones
['1'] = {vector3(-581.78, -166.96, 39.74), radius = 50.0},
['2'] = {vector3(-413.83, 1173.76, 337.04), radius = 120.0},
['3'] = {vector3(360.76, -1590.5, 36.95), radius = 90.0},
['4'] = {vector3(2048.74, 3418.85, 49.0), radius = 80.0}
}
Events
esx:onPlayerDeath
: The script listens for this event to trigger loot bag creation. Modify the Config.DeathEvent if you use a different event for handling player deaths.
Preview
tebex : Here
Other Scripts
Standalone|AdvancedZombieSystem
QBCore|RobberyCreator
QBCore|SafeZone
QBCore/ESX|LootPeds
QBCore/ESX|RadiationZones
Standalone|ZombieSystem
QBCore|Shop
QBCore|WeatherSync
QBCore|PhoneStoreRobbery
QBCore/ESX|InGameMusic
QBCore|CamperHousing
standalone|SurvivalHUD
QBCore|LootBags
Support:
you can join my discord for any support ! Sinor System
Code is accessible | only config |
Subscription-based | No |
Lines (approximately) | 350+ |
Requirements | ESX |
Support | Yes |
------------------------------------- | ---------------------------- |