๐ฅ๏ธ Instruction
How to add a new ring to the config fileโ
In this instruction, you will learn how to add a new ring to your script that can display a secret message when used.
This can be useful for creating immersive role-playing scenarios or adding some mystery to your game.
But first you will need:
- A ring name
- A ring image in png format
- QBCore or ESX framework
Create a new ringโ
- Create a new ring item in your frameworkโs item file. Depending on which framework you are using, this file may be located at
qb-core/shared/items.lua
orox_inventory/data/items.lua
. - Open the file with your text editor and add a new item with the following properties:
- The name property should be unique and match the name of your ring image file.
- The label property is what the player will see in their inventory.
- The description property is what the player will see when they hover over the item.
- You can change these properties according to your preference.
QBCoreโ
["newring"] = {
["name"] = "newring",
["label"] = "A new ring",
["weight"] = 1000,
["type"] = "item",
["image"] = "newringicon.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "The One Ring appeared perfectly plain and featureless, but when heated, the inscription appeared in fiery letters on the Ring.["
}
ESXโ
["ring1"] = {
label = "A ring",
weight = 1,
stack = false,
close = true,
description = "A paper box containing something"
}
Setup the rings imagesโ
Save your ring image in the keep-secretSocietyRings/build/rings
folder.
- The image should be in png format and have a transparent background.
- The image should also match the size and style of the other ring images in the folder.
Setup the configโ
Open the keep-secretSocietyRings/lua/server/config.lua
file with your text editor. This file contains the configuration settings for your script, such as the rings, message duration, and sounds.
Find the line that says ServerConfig.Rings = {
.
This is where you define the rings that can be used by your script.
Add a new line below it with the name and path of your ring's image, for example:
{
name = 'newring', -- must be unique
image = 'ring-3',
read_time = 10 -- how much time a player would have to read the message
},
- The name property should match the name of your ring item and image file.
- The image property should match the name of your ring image file without the extension.
- The read_time property is how long (in seconds) the player will have to read the secret message when they use the ring.
Save and close the file.
You have successfully added a new ring now restart the script/server!