🔧Config

Explanations for all config values.

Having trouble?

If you feel like we have explained any value poorly, please let us know on Discord so that we can update the documentation so that everyone understands it easily.

To understand the structure

Because we have extensive configuration files, nested tables is an inevitability. To keep track of which values are for which table we use the tablename.value. This can also stack, for example location.blip.enabled etc.

shared/config.lua

Settings

debug

If set to true, it will print out information in the console, false to disable it. Some information will still be printed out, such as missing arguments, despite this being disabled.

displayZones

Will display all blocked and allowed zones if set to true.

threadUpdateInterval

How often the script will update the plants in seconds, if you have insanely high values you can make this 10 seconds or more, but if you have low values, you can make this 1 second or less, 5+ seconds is recommended, I've optimized the script as much as possible but looping through and checking values for 500 plants every second is a huge task, so my recommendation is to keep it at 5+ seconds.

gatherClosePlantsInterval

How often the script will gather the closest plants to the player in seconds, this is to maintain high performance and not to have a lot of plants loaded at the same time.

databaseUpdateInterval

How many seconds between each time the database is updated, recommended to keep at around 5 minutes, which is 60 * 5, plants are always updated on script stop unless there's a connection loss to the database, in which case nothing on the server will be saved at all.

displayPressE

If the "Press E" box top left should be displayed or not, makes it easier to see if you're close enough to the plant BUT does use a bit of performance, therefore I added it as a setting.

distanceBetweenPlants

Can't place plants within the specified distance to prevent unrealistic spamming.

autoRemove

In seconds how long until the entity (plant and light) will be automatically removed, this is to prevent old entities sitting in impossible to find spots taking up performance, set to 0 to disable but is highly recommended to keep enabled, this will be checked every time databaseUpdateInterval is reached, meaning it will clear after all plants are saved.

logsEnabled

If logs should be enabled or not, if you don't want logs, set this to false. Webhook is in server/unlocked.lua to prevent people from stealing your webhook and spamming it.

logs

A collection of logs you can enable or disable.

logs.onPlant

When planting your plant

logs.onHandle

When watering / picking up etc

logs.onHarvest

When harvesting your plant (Items and amount is included)

logs.onLight

When handling a light (Placement/Pickup)

GlobalBlockedZones

You can't grow anything inside of these zones. If you want to disable a certain plant for a certain spot, you can do that in the plant's settings.

pos

The location where you want to block planting, has to be a vector3.

radius

The radius, aka how large the circle is.

Lights

interiorId

Basically, if the interior ID is 0, AKA outside, you will automatically have 65 light "points" added, or whatever you change it to. Feel free to add any interior ID in here as you wish. I've added a command called "getinteriorid" which will print the interior ID of the interior you are inside of in your F8 console, so you can easily add it to the table. You set the interior ID as the key and then the default light value as the value for that key. View the already entered ones as reference.

timeMultipliers

Each of these values represent the multiplier for an hour from 0-24, first table being 00:00, second being 01:00 etc and the last being 24:00, disable by setting all multipliers to 1.0. Basically, it fetches the IRL time using os.date(). It will then pick the corresponding multiplier for the hour. It will then multiply the interior light points by the multiplier. So if you have lights placed out during the night and it turns day because you have long plant timers, the light will be multiplied by a different value and might make it too bright. This feature is kind of hardcore but thought I'd add it in case anyone wanted to use it, if not, just set all multipliers to 1.0. The reason this is not based on the actual in-game time is simply because you can't fetch that server sided, meaning you need to have someone online to host the time etc.

props

The different lights you can place out and their settings.

props.model

The model of the prop.

item

The item name you use in order to place down a light.

radius

The radius the light can affect plants.

lightPoints

The maximum amount of light points that this light can give.

pointMultiplier

Depending on how far away you are from the light, you will get different light values. It is recommended to keep this as the default value, which is 0.1 to simulate realistic lighting.

zDecrease

Some props are weird, they can either float in the air or be in the ground. This value can be changed based on that, but is normally 0.985 to get it on the ground.

Plants

Every plant needs a unique key to be access easily. In order to not confuse this, the item you use is the same as that key. For example, when I use the item "coke_seed", it will access the Config.Plants.coke_seed values.

label

The label that will be displayed throughout the script for that plant.

growthTime

How long it will take for the plant to grow, in seconds.

settings

A collection of settings to handle the plant's growth values.

settings.removeOverTime

These are settings that will be removed over time, the amount depends on the values below. You can change the water and nutrition values here. They both have the same settings available.

settings.removeOverTime[x].label

The label that will be displayed throughout the script for this value.

settings.removeOverTime[x].min & settings.removeOverTime[x].max

The minimum and maximum for this value, recommended to keep at their default values 0 & 100.

settings.removeOverTime[x].bestValue.min & settings.removeOverTime[x].bestValue.max

The value you have to aim to hit in between in order for your plants to grow without losing quality.

settings.removeOverTime[x].valueToRemove

The amount of value of this setting you will lose, if this makes you go below the minimum best value you will start to lose quality.

settings.removeOverTime[x].valueRemoveTime

Time before a value "point" is lost, in seconds.

settings.removeOverTime[x].qualityToRemove

The amount of quality you remove everytime you cross the interval. Recommended to keep at 1, since anything higher might kill the plant insanely fast. For example, set it to 100 and the plant will instantly lose all it's quality.

settings.removeOverTime[x].qualityRemoveTime

In seconds, how long it takes before that quality is removed.

settings.other[x]

Works the same as above, only has small differences.

settings.other[x].timeToAdd

If your light value is too poor, you will have additional growth time added simulating that the plant struggles to grow without proper light. Make sure this value is not too harsh, otherwise it will end up making your plant completely passive and restricts it from growing.

settings.other[x].qualityRemoveTime

Works the same as qualityRemoveTime for removeOverTime settings, but it's now the interval for adding to your growth time.

plantingItems

Items that you need to use when planting your plant. Don't forget to add your seed in here, otherwise it won't be removed when used.

plantingItems.item

The item that you will set the values for.

plantingItems.remove

Whether to remove the item or not, set to true to remove upon use and false to keep the item when planting.

plantingItems.amount

The amount that you will need in order to plant. Also the amount that will be removed, given back etc.

plantingItems.giveBackOnHarvest

Set to true to give this item back on harvest, set to false or remove it completely to not get it back.

plantingItems.giveBackOnPickup

Set to true to give this item back on pickup, set to false or remove it completely to not get it back.

handlePlant

Which items, the amount and how much (0-100) you want to add to that value. Note that you can not change the water and nutrition key, they have to stay.

handlePlant.item

The item that will be used when handling the plant with this action.

handlePlant.amount

The item amount that will be used when handling the plant with this action.

handlePlant.toAdd

How much you want to add to the plant's value when handling the plant with this action.

reward

This is based on the quality of the plant, if you have the default values below this is how it works. If it has 33 in quality it will skip over 20 and check the next, the next one is 50 and the quality is not high enough meaning it will default back to the 20. If your values below are too high and it can't even reach the first one, you won't get anything from the plant and a notifiction stating the quality is too low. I would recommend similar values to the default ones but it's completely free to change, as long as it's between 0-100 and you follow the template. I recommend looking these over to ensure your server's economy align with the values. Note that you can add more than just one reward for each quality, view below.

reward = {
    [20] = {
        {item = "cokeleaf_quality0", amount = {3, 4}},
        -- You can add more values down here
        -- Just copy the table above and enter your values
    },
    [50] = {
        {item = "cokeleaf_quality1", amount = {4, 5}},
    },
    [70] = {
        {item = "cokeleaf_quality2", amount = {6, 7}},
    },
},

reward[x].item

The item that you will be given.

reward[x].amount

A random amount between the first and last value that you will be given.

lowerOutside

If you wish to automatically lower the plant when placed outside, edit this value. It was put in place so that you can simulate it being used in soil whilst also allowing you to plant it inside with a pot. Please note that using a smaller prop model and lowering it may cause it to be unreachable. We recommend that you only use the medium and large marijuana plant prop if you do decide to change this value.

growthState

In here you change the different labels and models for the plant's growth state. In the coke plant example, the plant will start out as a seed, then grow into a small plant, then a medium plant and finally a big plant. All props can be found at: https://forge.plebmasters.de/objects.

growthState.label

The label that will be displayed throughout the script for the growth state.

growthState.model

The model for that plant's state.

growthState.zDecrease

To predictibly place the plant on the ground in front of a player when planting, you remove 0.985 to the z coordinate. Some props don't work the same, so I left this value available to change in case you run into that issue.

growthState.growthValue

The growth value the plant has to hit in order to change it's label and prop.

blocked

If set to true, the zones below will be blocked to place in, if set to false, the zones below will be the only ones you can place in.

zones

The zones for the blocked variable above.

zones.pos

The position for the middle of the circle. Has to be a vector3 value.

zones.radius

The radius for the zone.

blipColour

The color of the bip and area if you are displaying the blocked / restricted zones.

surfaceChecking

If set to true, it will check if the plant is on a surface that is allowed, if set to false, it will not check

surfaces

Set the values below to true if you want to be able to plant on that surface, all other surfaces that are not listed will block planting. View the example below.

surfaces = {
    [1333033863] = true,-- grass
    [-1286696947] = true, -- grass short
    [-461750719] = true, -- grass long
    [-700658213] = true, -- soil
    [1109728704] = true, -- mud_deep
    [-642658848] = true, -- tarpaulin
    [-1942898710] = true, -- mud_hard
    [-1885547121] = true, -- hill top
    -- Want to find more surface hashes easily? Enable debug in Config.Settings and you can see the surface hash when trying to plant
},

Last updated