How to define item required
This configuration defines required items for specific loot types. Players must have these items in their inventory to interact with certain lootable entities.
Purpose:
Adds realism and progression by requiring specific tools or items for interaction.
Limits access to certain loot types based on player readiness or inventory.
Example Configuration:
Config.lootTypeItemNeeded = {
['prop_loot'] = {items = "blowtorch", label = "You need a charged blowtorch to interact", remove = true},
['car_loot'] = {items = "wrench", label = "You need a wrench to search this car", remove = false},
}
Explanation:
items
: The name of the item required to interact with this loot type (e.g.,blowtorch
orwrench
).label
: The message displayed if the player does not have the required item.remove
: Iftrue
, the specified item will be consumed (removed from the inventory) after interaction.
Use Case:
A player cannot search a vehicle (
car_loot
) without awrench
in their inventory.If they try to loot a box (
prop_loot
), they must have ablowtorch
. The blowtorch can optionally be removed after use ifremove
is set totrue
.
Last updated