KCD NPC Loot β Random Loot System for FiveM
KCD NPC Loot adds a configurable random loot system to NPCs on your FiveM server.
When a player searches an NPC, the script generates random loot based on the items and probabilities defined in the configuration. Each item can have its own drop chance as well as minimum and maximum amounts, giving you full control over how common or rare certain items should be.
Features
- π² Random NPC Loot
Every NPC can receive randomly generated items when searched. - βοΈ Fully Configurable Loot Table
Configure your own items, drop chances and quantities directly in the config. - π Individual Drop Chances
Every item can have its own percentage chance. - π¦ Random Item Amounts
Define minimum and maximum quantities for each item. - π Server-Side Loot Generation
Loot is generated server-side for better security. - π€ Persistent Loot Per NPC
Loot is generated when the NPC is searched and will not simply reroll every time the inventory is reopened. - π― Minimum Loot Option
Configure whether NPCs may be completely empty or should always contain a minimum number of items. - π Item Validation
Invalid or missing ox_inventory items can be detected to make configuration easier. - π KCD Jobcreator Integration
Designed to work together with KCD Jobcreator. NPC searching can be enabled in the Jobcreator and automatically use KCD NPC Loot when the resource is installed. - π§© Standalone & Optional Integration
KCD NPC Loot remains a separate resource. KCD Jobcreator does not require it unless NPC loot functionality is enabled.
Example Configuration
Config.MinLootItems = 1
Config.Loot = {
{ name = 'water', chance = 45.0, min = 1, max = 2 },
{ name = 'bread', chance = 35.0, min = 1, max = 2 },
{ name = 'money', chance = 30.0, min = 5, max = 75 },
{ name = 'phone', chance = 8.0, min = 1, max = 1 },
{ name = 'lockpick', chance = 12.0, min = 1, max = 2 },
{ name = 'bandage', chance = 18.0, min = 1, max = 2 }
}
For example, chance = 8.0 gives the item an 8% chance of appearing in the NPC's inventory.
Requirements
- FiveM
- ox_inventory
- ox_lib
KCD Integration
For the best experience, KCD NPC Loot can be combined with KCD Jobcreator.
The Jobcreator handles whether an NPC can be searched, while KCD NPC Loot handles the random inventory and loot generation.
KCD NPC Loot β Simple to configure. Easy to integrate. More rewarding NPC interactions.