[FREE] Weed System

Showcase

Download

Features

  • Take care of your weed plant! The reward out of it will be depending on how you take care of it
  • Your plant requires water, herbicide and fertilizer
  • Blacklist zones where players can’t place the pot
  • Integrated shop for weed planting tools and seeds
  • Admin commands (getId, tpPlant, deletePlant) - Get the ID of the closest plant you’re standing to, teleport to the plant using the ID or delete it using the ID
  • Limit the number of plants each player can grow
  • Ability to move your plant while it’s growing
  • Growth and needs rates are customizable in config
  • Target via QT, QB or OX Target
  • Localization available

Support on discord

Documentation Site

Code is accessible Yes
Subscription-based No
Lines (approximately) ~1600
Requirements ox_lib, oxmysql
Support Yes
9 Likes

And the Item List?

yeah please add the item list

heres the list i made so far for Ox_inventory

local Items = {
{
name = ‘pot’,
label = ‘Plant Pot’,
weight = 500,
stack = true,
close = true,
description = ‘Used for planting seeds.’
},
{
name = ‘shovel’,
label = ‘Shovel’,
weight = 800,
stack = false,
close = true,
description = ‘Useful for digging soil.’
},
{
name = ‘fertilizer’,
label = ‘Fertilizer’,
weight = 300,
stack = true,
close = true,
description = ‘Improves plant growth.’
},
{
name = ‘distilledwater’,
label = ‘Distilled Water’,
weight = 300,
stack = true,
close = true,
description = ‘Keeps the plant hydrated.’
},
{
name = ‘herbicide’,
label = ‘Herbicide’,
weight = 300,
stack = true,
close = true,
description = ‘Used to maintain plant health.’
},
{
name = ‘canister’,
label = ‘Canister’,
weight = 1000,
stack = true,
close = true,
description = ‘Canister of nutrients or chemicals.’
},
{
name = ‘weed_seed’,
label = ‘Weed Seed’,
weight = 50,
stack = true,
close = true,
description = ‘Seed for growing weed.’
},
{
name = ‘weed_leaf’,
label = ‘Weed Leaf’,
weight = 100,
stack = true,
close = true,
description = ‘Harvested product of the weed plant.’
},
}

We are making docs i think it will be finished tomorrow

So and whats next? you can use them or sell them?

We made weed system. We will add in the future to craft some items or something like that and sell for now u have just to grow a weed :slight_smile:

This works not with QB Inventory? :unamused:

how does it work when it comes to plants being in shells or restarts ?

If your shells are static it will be where player put. On restart our script saves last location of plant.

Here is list of items for QB Inventory

1 Like

I’ve worked on the code to make it more effective for roleplay:

update:

  • weed_pants TABLE has now last_fed and player_identifyer

  • a function where the server detects whether a pot has not been planted with seeds or a plant has been left without fertilizer or insecticide for more than 10 minutes [time can be changed] then he deletes the plant from the TABLE

  • console print of the new function

main.lua (22.9 KB)

If you use Chezza Inventory

change in shared.lua

imagePath = 'nui://inventory/web/dist/assets/items/%s.png', --/servers/ESXLegacy_40321B.base/resources/[inventory]/inventory/web/dist/assets/items

and also change where you put your seeds:

['seed_amnesia'] = {
            name = 'seed_amnesia', -- wichtig für Chezza inventory image abfrage
            item = 'untrimmed_amnesia', -- item beim fertigen aufziehen der Pflanze
            label = 'Amnesia', -- Display Name
            reward = { min = 2, max = 10 }, -- Stückzahl je nach Pflege
            stages = {
                [1] = { prop = `bkr_prop_weed_01_small_01c`, percent = 15 },
                [2] = { prop = `bkr_prop_weed_med_01a`, percent = 40 },
                [3] = { prop = `bkr_prop_weed_lrg_01a`, percent = 70 }
            },
        },

and least in client.lua:

local function SeedMenu(Plant)
    local seedsOptions = {}

    for k, v in pairs(Config.seeds) do
        local hasItem = lib.callback.await('syniq_weed:hasItem', false, k, 1)

        if hasItem then
            seedsOptions[#seedsOptions+1] = {
                title = v.label,
                icon = Config.imagePath:format(v.item),
                image = Config.imagePath:format(v.name),

                description = locale('seedMenu.putSeed'),
                onSelect = function ()
                    local hasShovel = lib.callback.await('syniq_weed:hasItem', false, Config.items.shovel, 1)

                    if hasShovel then
                        local object = CreateObj(Props.shovel, 0x6F06, vector3(0.0, 0.0, 0.0), vector3(0.0, 0.0, 0.0))
                        if not object then return end

                        -- Starte die Progressbar
                        local success = ProgressBar(locale('progress.placeSeed'), 5000, Animations.harvest[1], Animations.harvest[2], Animations.harvest[3])

                        -- Danach aufräumen
                        ClearPedTasks(cache.ped)
                        DeleteEntity(object)
                        FreezeEntityPosition(cache.ped, false)

                        if success then
                            local data = {
                                id = Plant.data.id,
                                seed = k
                            }

                            TriggerServerEvent('syniq_weed:placeSeed', data)
                        end
                    else
                        Notification(locale('notify.error.title'), locale('notify.error.noShovel'), 5000, 'error')
                    end
                end
            }
        end
    end

    if #seedsOptions == 0 then
        seedsOptions[#seedsOptions+1] = {
            title = locale('seedMenu.noSeed'),
            disabled = true,
        }
    end

    lib.registerContext({
        id = 'seed_menu',
        title = locale('seedMenu.title'),
        options = seedsOptions
    })

    lib.showContext('seed_menu')
end

what happens after the plant is fully planted though it just stays in the pot or is there like a harvest system as well?

Where can I find the SQL? It’s not in the script or the documentation.