Configuration
After completing the installation steps, you can fine-tune the script's behavior in the config.lua file. The file is fully commented to explain every option.
General Settings
These settings control the overall functionality and default behaviors of the script.
-
defaultModel:
- Type:
string(model hash or name) - Default:
`prop_paper_bag_01` - Description: The default 3D model used for any item that doesn't have a specific model assigned in the
itemstable. This acts as a fallback to prevent errors with unconfigured items.
- Type:
-
dropRange:
- Type:
number - Default:
1.0 - Description: This setting determines the maximum radius an item will be created within when dropped on the ground.
- Type:
-
randomHeading:
- Type:
boolean - Default:
false - Description: This affects the visual variety of how items are displayed in the environment. When set to
true, items dropped on the ground will have a random orientation (rotation).
- Type:
-
pickupType:
- Type:
string - Default:
ox_inventory_drop - Options:
ox_inventory_drop,ox_target,qb_target,sleepless_interact,interact - Description: This crucial setting determines which interaction system the script uses for picking up items. It's essential for ensuring compatibility with your server's framework. Choose the option that matches your server's setup.
- Type:
Item Specific Prop Configuration
To associate a visual prop with an item, you need to define the prop property within the item's configuration in @ox_inventory/data/items.lua.
If the item is a weapon hash (e.g., WEAPON_PISTOL), you don't need to add a prop, as the script automatically fetches the correct weapon model.
Example:
items = {
['money'] = {
label = 'Money',
prop = `prop_anim_cash_pile_01`,
},
['phone'] = {
label = 'Phone',
weight = 190,
stack = false,
prop = `sf_prop_sf_npc_phone_01a`,
},
},Animations
These tables configure the animations that play when players place or pick up items.
- pickupAnimation:
enabled- Type:
boolean - Default:
true - Description: Set to
trueto enable the animation,falseto disable it.
- Type:
low(Animation for picking up items from a low position, e.g., the ground.)- dict
- name
- blendInSpeed
- blendOutSpeed
- duration
- flags
high(Animation for picking up items from a higher position or in a different context.)- dict
- name
- blendInSpeed
- blendOutSpeed
- duration
- flags
Localizable Text (locales)
This table holds all the text strings displayed to the user in the UI, allowing for easy localization.
- locales
pickupItem- Default:
Pickup %sx %s - Description: The text shown when looking at a pickupable item. The first
%sis replaced by the item count, and the second%sby the item name (e.g., "Pickup 3x Phone").
- Default:
tooHeavy- Default:
Item weight exceeds your carrying capacity. - Description: The error message displayed if the player's inventory is too full (by weight)
- Default: