Instruction
This document will show you how to use keep-packager
, a script that allows you to create and use packages in your server.
INFO
This script utilizes two config files:
keep-packager/config.lua
keep-packager/lua/server/config.lua
Ensure that you have read and understand both files, and adjust them according to your preferences.
How to add a new box
A box is a type of package that you can use to store items inside it (right? a box is box). You can customize the box's label, opening duration, unused and filled items and allowed items.
To add a new box types (items), follow these steps:
Open the keep-packager/lua/server/config.lua
file in your text editor.
Find the ServerConfig.Boxes
table in the file. This table contains all the existing boxes that you can use or modify.
Add a new entry to the table using this template:
{
label = 'Paper Box',
opening_duration = 1,
unused = 'emptypaperbox',
filled = 'usedpaperbox',
allowed_items = {},
permanent = false
}
Field | Description |
---|---|
label | Label of the box shown in inventory |
opening_duration | Time in seconds to open the box |
unused | Item representing an empty box |
filled | Item representing a filled box with unique items inside it |
allowed_items | List of items allowed in the box (leave empty to allow all items) |
permanent | Determines if the box can be reused after opening |
Exmaple
ServerConfig.Boxes = {
-- ...
--- existing code
{
label = 'Paper Box',
opening_duration = 1,
unused = 'emptypaperbox',
filled = 'usedpaperbox',
allowed_items = {},
permanent = false
}
}
Save and close the file.
How to create a new mystery box
A mystery box is a special type of box that contains random items. You can customize the mystery box's label, opening duration, unused and filled items, and rarity.
To create a new mystery box, follow these steps:
Open the keep-packager/lua/server/config.lua
file in your text editor.
- Find the
ServerConfig.MysteryBoxes
table in the file. This table contains all the existing mystery boxes that you can use or modify. - Add a new entry to the table using this template:
{
-- The name of the item that represents the mystery box. It must be unique and match the name in the items table.
item_name = 'mysterybox',
-- The time in seconds that it takes to open the mystery box.
opening_duration = 1,
-- The type of distribution for the items in the mystery box. It can be either 'individual' or 'all'.
-- If 'individual', each item has its own chance of being added to the box.
-- If 'all', all items are added to the box with their respective amounts.
distribution_type = 'individual',
-- The chance is a number from 0 to 100 that determines how likely that item is to be added to the box.
-- The info table is optional and can contain additional information about the item, such as metadata.
contain = {
items = {
{ item_name = 'painkillers', amount = 1, chance = 100, info = {} },
{ item_name = 'ifaks', amount = 1, chance = 10, info = {} },
{ item_name = 'bandage', amount = 1, chance = 5, info = {} },
},
-- The list of money types that can be in the mystery box. Each money type has a name, an amount, and a chance.
-- The chance is a number from 0 to 100 that determines how likely that money type is to be added to the box.
money = {
{ item_name = 'money', amount = 100000, chance = 5 },
}
},
},
- Save and close the file.
Support
If you need any help or have any questions about our products, please join our discord channel: https://discord.gg/ccMArCwrPV