Updated item creation guide (#109)

This commit is contained in:
ParuThePro authored and GitHub committed 2023-03-20 17:51:39 +11:00
1 parent 928c84178d
commit efff5c9a03
1 file changed
+17 -17
+17 -17
View File
@@ -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. 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. You can also define the number of slots, the maximum weight, blacklist and whitelist items.
* itemName: `table` * itemName:
* size: `{number, number}` * slots: number
* First index is number of slots the container will have. * The number represents the amount of slots
* Second index is the maximum weight of the container. * maxWeight: number
* blacklist: `table` * The number represents the maximum weight within the container
* Key-value pairs of item name and true * blacklist:
* `['itemName'] = true` * Supports single and multiple items
* whitelist: `table` * `{ 'testburger', 'testburger2' }`
* Key-value pairs of item name and true * whitelist:
* `['itemName'] = true` * Supports single and multiple items
* `{ 'testburger', 'testburger2' }`
**Example:** **Example:**
```lua ```lua
['paperbag'] = { setContainerProperties('paperbag', {
size = {5, 1000}, slots = 5,
blacklist = { maxWeight = 1000,
['testburger'] = true -- No burgers! blacklist = { 'testburger' }
} })
},
``` ```