From efff5c9a0342809ca8d78c3781591fa9a2e3235e Mon Sep 17 00:00:00 2001 From: ParuThePro <35810485+paruthepro@users.noreply.github.com> Date: Mon, 20 Mar 2023 06:51:39 +0000 Subject: [PATCH] Updated item creation guide (#109) --- docs/ox_inventory/Guides/creatingItems.md | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/ox_inventory/Guides/creatingItems.md b/docs/ox_inventory/Guides/creatingItems.md index c938550a..3d90c3bf 100644 --- a/docs/ox_inventory/Guides/creatingItems.md +++ b/docs/ox_inventory/Guides/creatingItems.md @@ -239,28 +239,28 @@ Like with other items the item must first be registered. }, ``` -When registered you can define the item as a container under the `Items.containers` table in `/modules/items/server.lua` +When registered you can define the item as a container in `/modules/items/containers.lua` The key for the container is the `name` you gave it when registering the item. You can also define the number of slots, the maximum weight, blacklist and whitelist items. -* itemName: `table` - * size: `{number, number}` - * First index is number of slots the container will have. - * Second index is the maximum weight of the container. - * blacklist: `table` - * Key-value pairs of item name and true - * `['itemName'] = true` - * whitelist: `table` - * Key-value pairs of item name and true - * `['itemName'] = true` +* itemName: + * slots: number + * The number represents the amount of slots + * maxWeight: number + * The number represents the maximum weight within the container + * blacklist: + * Supports single and multiple items + * `{ 'testburger', 'testburger2' }` + * whitelist: + * Supports single and multiple items + * `{ 'testburger', 'testburger2' }` **Example:** ```lua -['paperbag'] = { - size = {5, 1000}, - blacklist = { - ['testburger'] = true -- No burgers! - } -}, +setContainerProperties('paperbag', { + slots = 5, + maxWeight = 1000, + blacklist = { 'testburger' } +}) ```