La FactorY
Script documentation

YF-Kush: documentation

YF-Kush turns weed buds into hash in four hands-on steps: sieving, pressing, cutting and bagging. Each station has its own animations, 3D props and mini-game, with no menu hiding the action.

v1.0.0ox_inventoryox_targetno framework needed

YF-Kush – 48 €

Overview

  • Sieve, press and table placeable by players, saved in the database.
  • Four strains: OG Kush, Purple Haze, White Widow, Blue Dream.
  • An NPC vendor for the equipment.
  • No framework required: works on ESX, QBCore, Qbox or without a framework.
  • Compatible with kq_weed, without depending on it.
  • French and English included.

Presentation video, from buying the equipment to bagging: watch YF-Kush on YouTube.

Requirements

ResourceRole
ox_libMenus, inputs, notifications, client-server calls.
ox_inventoryAll items, the vendor's money and the images.
ox_targetInteractions with the stations and the vendor.
oxmysqlSaves the placed sieves, presses and tables.
Game build 2545 minimum

The sieve animation comes from The Contract DLC. Set sv_enforceGameBuild 2545 or higher in your server.cfg, otherwise the player sieves without an animation.

OneSync must be enabled, as on almost every current server: the server checks the players' distance before every action.

Installation

Six steps, in this order.

  1. Add the resource

    Get YF-Kush from the Cfx.re portal (see Getting your purchases). Copy the yf-kush folder into your resources, without renaming it: the protected version is tied to that name. Then add it to your server.cfg, after its dependencies.

    server.cfg
    ensure ox_lib
    ensure oxmysql
    ensure ox_inventory
    ensure ox_target
    ensure yf-kush
  2. Create the SQL tables

    Run install.sql on your database. It creates yf_kush_tamis, yf_kush_presses and yf_kush_tables. It is safe to run again.

  3. Declare the items

    Add the block from the Items section at the end of ox_inventory/data/items.lua, before the last closing brace.

  4. Copy the images

    Copy the 25 yf_*.png images from the install/images folder into ox_inventory/web/images.

  5. Adjust the config

    Open shared/config.lua: language, accepted buds, baggie, kq_weed tables and vendor. Details in Configuration.

  6. Restart the server

    A full restart is needed the first time, to load the new ox_inventory items. The console shows how many sieves, presses and tables were loaded.

Items

25 items: the equipment, the buds provided by the script, then the four steps of the chain for each strain. The block below uses English labels; the French labels are in the French documentation.

ox_inventory/data/items.lua
-- yf-kush

['yf_tamis'] = {
    label = "Pollen Sieve",
    weight = 8000,
    stack = true,
    close = true,
    consume = 0,
    client = {
        export = 'yf-kush.useTamis'
    },
},

['yf_baguettes'] = {
    label = "Beating Sticks",
    weight = 500,
    stack = true,
    close = true,
    consume = 0,
},

['yf_presse'] = {
    label = "Pollen Press",
    weight = 10000,
    stack = true,
    close = true,
    consume = 0,
    client = {
        export = 'yf-kush.usePresse'
    },
},

['yf_table'] = {
    label = "Cutting Table",
    weight = 15000,
    stack = true,
    close = true,
    consume = 0,
    client = {
        export = 'yf-kush.useTable'
    },
},

['yf_sachet_vide'] = {
    label = "Empty Baggie",
    weight = 1,
    stack = true,
    consume = 0,
},

['yf_tete_og_kush'] = {
    label = "OG Kush Bud",
    weight = 2,
    stack = true,
    consume = 0,
},

['yf_tete_purple_haze'] = {
    label = "Purple Haze Bud",
    weight = 2,
    stack = true,
    consume = 0,
},

['yf_tete_white_widow'] = {
    label = "White Widow Bud",
    weight = 2,
    stack = true,
    consume = 0,
},

['yf_tete_blue_dream'] = {
    label = "Blue Dream Bud",
    weight = 2,
    stack = true,
    consume = 0,
},

['yf_pollen_og_kush'] = {
    label = "Pollen [OG Kush]",
    weight = 50,
    stack = true,
    consume = 0,
},

['yf_pollen_purple_haze'] = {
    label = "Pollen [Purple Haze]",
    weight = 50,
    stack = true,
    consume = 0,
},

['yf_pollen_white_widow'] = {
    label = "Pollen [White Widow]",
    weight = 50,
    stack = true,
    consume = 0,
},

['yf_pollen_blue_dream'] = {
    label = "Pollen [Blue Dream]",
    weight = 50,
    stack = true,
    consume = 0,
},

['yf_plaque_og_kush'] = {
    label = "Hash Slab [OG Kush]",
    weight = 100,
    stack = true,
    consume = 0,
},

['yf_plaque_purple_haze'] = {
    label = "Hash Slab [Purple Haze]",
    weight = 100,
    stack = true,
    consume = 0,
},

['yf_plaque_white_widow'] = {
    label = "Hash Slab [White Widow]",
    weight = 100,
    stack = true,
    consume = 0,
},

['yf_plaque_blue_dream'] = {
    label = "Hash Slab [Blue Dream]",
    weight = 100,
    stack = true,
    consume = 0,
},

['yf_barrette_og_kush'] = {
    label = "Hash Bar [OG Kush]",
    weight = 10,
    stack = true,
    consume = 0,
},

['yf_barrette_purple_haze'] = {
    label = "Hash Bar [Purple Haze]",
    weight = 10,
    stack = true,
    consume = 0,
},

['yf_barrette_white_widow'] = {
    label = "Hash Bar [White Widow]",
    weight = 10,
    stack = true,
    consume = 0,
},

['yf_barrette_blue_dream'] = {
    label = "Hash Bar [Blue Dream]",
    weight = 10,
    stack = true,
    consume = 0,
},

['yf_pochon_og_kush'] = {
    label = "Bag of Hash [OG Kush]",
    weight = 11,
    stack = true,
    consume = 0,
},

['yf_pochon_purple_haze'] = {
    label = "Bag of Hash [Purple Haze]",
    weight = 11,
    stack = true,
    consume = 0,
},

['yf_pochon_white_widow'] = {
    label = "Bag of Hash [White Widow]",
    weight = 11,
    stack = true,
    consume = 0,
},

['yf_pochon_blue_dream'] = {
    label = "Bag of Hash [Blue Dream]",
    weight = 11,
    stack = true,
    consume = 0,
},
ItemRoleWeight
Pollen Sieve
yf_tamis
Placeable station: sieving8,000 g
Beating Sticks
yf_baguettes
Needed to beat the sieve500 g
Pollen Press
yf_presse
Placeable station: pressing10,000 g
Cutting Table
yf_table
Placeable station: cutting and bagging15,000 g
Empty Baggie
yf_sachet_vide
Used up when bagging1 g
OG Kush Bud
yf_tete_og_kush
Goes into the sieve2 g
Purple Haze Bud
yf_tete_purple_haze
Goes into the sieve2 g
White Widow Bud
yf_tete_white_widow
Goes into the sieve2 g
Blue Dream Bud
yf_tete_blue_dream
Goes into the sieve2 g
Pollen [OG Kush]
yf_pollen_og_kush
Comes out of the sieve50 g
Pollen [Purple Haze]
yf_pollen_purple_haze
Comes out of the sieve50 g
Pollen [White Widow]
yf_pollen_white_widow
Comes out of the sieve50 g
Pollen [Blue Dream]
yf_pollen_blue_dream
Comes out of the sieve50 g
Hash Slab [OG Kush]
yf_plaque_og_kush
Comes out of the press100 g
Hash Slab [Purple Haze]
yf_plaque_purple_haze
Comes out of the press100 g
Hash Slab [White Widow]
yf_plaque_white_widow
Comes out of the press100 g
Hash Slab [Blue Dream]
yf_plaque_blue_dream
Comes out of the press100 g
Hash Bar [OG Kush]
yf_barrette_og_kush
Comes out of the cutting table10 g
Hash Bar [Purple Haze]
yf_barrette_purple_haze
Comes out of the cutting table10 g
Hash Bar [White Widow]
yf_barrette_white_widow
Comes out of the cutting table10 g
Hash Bar [Blue Dream]
yf_barrette_blue_dream
Comes out of the cutting table10 g
Bag of Hash [OG Kush]
yf_pochon_og_kush
Final product, ready to sell11 g
Bag of Hash [Purple Haze]
yf_pochon_purple_haze
Final product, ready to sell11 g
Bag of Hash [White Widow]
yf_pochon_white_widow
Final product, ready to sell11 g
Bag of Hash [Blue Dream]
yf_pochon_blue_dream
Final product, ready to sell11 g

Configuration

shared/config.lua is the only file to edit. Rates, animations and positions are fixed in the script.

SettingDefaultEffect
Config.locale'fr'Language of the texts shown to players: the name of a file in the locales/ folder. Provided: 'fr', 'en'.
Config.tamisItemsyf_tete_*For each strain, the items the sieve accepts as buds. Replace them with the buds of your weed script; several names are allowed per strain. A name that does not exist in ox_inventory is ignored. When a sieve is picked up, the buds returned are the first valid item in the list.
Config.emptyBag'yf_sachet_vide'The item used up as an empty baggie when bagging, one per bag.
Config.kqWeedTablesfalsetrue: cutting and bagging also work on the kq_weed packaging table. The script's own table works in every case.
Config.shopThe equipment vendor: see The vendor.
shared/config.lua
Config.locale = 'en'

Config.tamisItems = {
    og_kush     = { 'yf_tete_og_kush' },
    purple_haze = { 'yf_tete_purple_haze' },
    white_widow = { 'yf_tete_white_widow' },
    blue_dream  = { 'yf_tete_blue_dream' },
}

Config.emptyBag = 'yf_sachet_vide'

Config.kqWeedTables = false

Config.shop = {
    enabled  = true,
    coords   = vec4(-911.87, -1269.17, 4.22, 111.8),
    currency = 'black_money',
    hours    = { open = 0, close = 0 },
    items = {
        { item = 'yf_tamis',       price = 3000,  stock = -1 },
        { item = 'yf_baguettes',   price = 500,   stock = -1 },
        { item = 'yf_presse',      price = 15000, stock = -1 },
        { item = 'yf_table',       price = 5000,  stock = -1 },
        { item = 'yf_sachet_vide', price = 2,     stock = -1 },
    },
}

The production chain

One full batch, from the sieve to the bag. The rates are fixed and the same for all four strains.

100budsin the sieve2 g each
10pollens10 buds → 1 pollen50 g each
5slabs2 pollens → 1 slab100 g each
50bars1 slab → 10 bars10 g each
50bags1 bar + 1 baggie11 g each
Selling is not included

YF-Kush covers production. To sell the bags, plug the items yf_pochon_og_kush, yf_pochon_purple_haze, yf_pochon_white_widow and yf_pochon_blue_dream into your dealing script.

The stations

The sieve, the press and the table are placed from the inventory: use the item, aim at the ground, ← → to rotate, E to place, Backspace to cancel. They stay in place after a restart.

  • Any player can use and pick up a placed station, except while it is in use.
  • Options appear within 1.5 m of the station.
  • 60 stations of each type at most on the map.
yf_tamis · yf_baguettes

Sieve

  • "Load buds": only one strain at a time.
  • At 100 buds, beating starts on its own, sticks in hand.
  • The player sits facing the sieve; left click = two strikes.
  • 5 clicks → 1 pollen, 50 clicks for the batch.
  • Esc stops; "Resume sieving" carries on later.
  • The sticks never wear out. Picking up the sieve returns the buds.
yf_presse

Press

  • "Press pollen": choose the strain, 2 pollens are needed.
  • Camera on the press; left click to drop each pollen into the mould.
  • The character works the press and the slab appears.
  • Backspace cancels before pressing, with nothing lost.
yf_table

Table · cutting

  • "Cut a hash slab".
  • Hold left click to pick up the knife and move the mouse.
  • Hold the blade on the line for 1.5 s: the bar comes off.
  • 9 lines → 10 bars. You cannot fail.
  • Backspace stops: the slab is kept.
yf_table · yf_sachet_vide

Table · bagging

  • "Bag the hash": up to 10 bars per round.
  • The cursor appears. Hold left click to drag a baggie onto the centre slot.
  • Bring a bar into contact with the baggie: the bag fills and goes onto the pile.
  • Backspace stops: bags already filled are kept.

The vendor

An NPC sells the chain's equipment. He buys nothing back. He appears when players come near, during his opening hours.

SettingEffect
enabledfalse removes the vendor, if you sell the equipment elsewhere.
coordsFeet position and heading, as vec4(x, y, z, heading).
currencyox_inventory item used as currency: 'black_money' or 'money'.
hoursIn-game time. open = close: always open. open > close: open at night, for example 22 → 6.
itemsItems sold, price and stock (-1 = unlimited). A limited stock refills at every restart.
Item soldDefault price
Pollen Sieve
yf_tamis
$3,000
Beating Sticks
yf_baguettes
$500
Pollen Press
yf_presse
$15,000
Cutting Table
yf_table
$5,000
Empty Baggie
yf_sachet_vide
$2

The NPC model (s_m_y_dealer_01) cannot be changed.

With kq_weed

YF-Kush works on its own. If your server uses kq_weed, three settings are enough for its buds, baggie and table to feed the chain.

shared/config.lua
Config.tamisItems = {
    og_kush     = { 'kq_weed_bud_og_kush' },
    purple_haze = { 'kq_weed_bud_purple_haze' },
    white_widow = { 'kq_weed_bud_white_widow' },
    blue_dream  = { 'kq_weed_bud_blue_dream' },
}

Config.emptyBag = 'kq_weed_bag_empty'

Config.kqWeedTables = true

To accept both the kq_weed buds and the script's own, list both names: og_kush = { 'kq_weed_bud_og_kush', 'yf_tete_og_kush' }.

Languages

Every text shown to players is in locales/, readable and editable. To add a language:

  • copy locales/en.lua to locales/de.lua;
  • replace Locales['en'] with Locales['de'] and translate the sentences;
  • keep the %d and %s in the same order;
  • set Config.locale = 'de'.

A missing sentence falls back to French. Item names are translated in items.lua.

Troubleshooting

Items have no image in the inventory

Check that the 25 yf_*.png files are in ox_inventory/web/images, then clear the FiveM cache: ox_inventory often keeps the old images.

The vendor refuses the sale even though I have dirty money

The name of the dirty money item depends on the server. On QBCore it is often markedbills. Set the right name in Config.shop.currency.

The sieve refuses my weed buds

Add the exact names of your buds to Config.tamisItems, under the right strain. The names must exist in ox_inventory.

The kq_weed table offers nothing

Set Config.kqWeedTables = true and check that kq_weed is started.

The player sieves without an animation

The server runs on a build that is too old. Set sv_enforceGameBuild to 2545 or higher.

A station cannot be picked up

Someone is using it: a station cannot be picked up during a batch, pressing, cutting or bagging. You also need room in your inventory.

A text shows up as a code, for example cond_count

The sentence is missing from your language file. Add the key in locales/, copying the line from fr.lua.

Editable files

The script is protected by the Cfx.re escrow. These stay readable and editable: shared/config.lua, the locales/ folder and install.sql.

Other guides

All documentation

  1. Join the La FactorY Discord.
  2. Open a ticket naming the product.
  3. The team gets back to you quickly to complete the purchase.
Open Discord