# Configuration

## Strains

<mark style="color:yellow;">Weed Strains are</mark> <mark style="color:red;">not</mark> <mark style="color:yellow;">included, your server must have items made for each option in the config</mark>

* &#x20;[Weed Farm V2](/solos/weed-farm-v2.md) <mark style="color:green;">includes custom strains for your server.</mark>&#x20;

* Here you can customize your strain options&#x20;

* Each strain must follow the same format
  * **Joint:** joint item for strain&#x20;
  * **Effect:** What effect the player will get when using this joint (see [#effects](#effects "mention")below)
  * **Receive:** How many joints players will recieve
  * **Required:** What weed item is required to make this joint
    * This can be the strains bag of weed, bud, whatever you'd like
  * **Required Amount:** How many of this weed item is required to make joint(s)

```lua
config.strains = {      
    ['Northern Lights'] = {     
        joint = 'northern_lights_joint',                -- Item name of the joint that player will receive
        effect = 'stress',                              -- Effect that will be applied to player when smoking this joint 
        receive = 1,                                    -- Amount of joints that player will receive
        required = {        
            item = 'northern_lights_bag',               -- Item name of the weed that is required to roll this joint (can be dry bud, bag of weed, whatever you want)
            amount = 1,                                 -- Amount of weed required to roll this joint
        },
    },
    ['Blue Dream'] = { 
        joint = 'blue_dream_joint', 
        effect = 'armor',
        receive = 1, 
        required = { 
            item = 'blue_dream_bag', 
            amount = 1, 
        },
    },
    ['Pineapple Express'] = {
        joint = 'pineapple_express_joint', 
        effect = 'speed',
        receive = 1, 
        required = { 
            item = 'pineapple_express_bag', 
            amount = 1, 
        },
    },
    ['Sour Diesel'] = {
        joint = 'sour_diesel_joint', 
        effect = 'stamina',
        receive = 1, 
        required = { 
            item = 'sour_diesel_bag', 
            amount = 1, 
        },
    },
    ['Strawberry Kush'] = {
        joint = 'strawberry_kush_joint',
        effect = 'health',
        receive = 1,
        required = {
            item = 'strawberry_kush_bag',
            amount = 1,
        },
    },
    ['Golden Goat'] = {
        joint = 'golden_goat_joint',
        effect = 'stress',
        receive = 1,
        required = {
            item = 'golden_goat_bag',
            amount = 1,
        },
    },
}
```

## Effects

* Here you can customize the different joint effects or even add your own!
* Each effect in the [#strains](#strains "mention") config must be included here.&#x20;
* The effect must include its logic / function / event within the `action = function()`
  * <mark style="color:green;">see the</mark> <mark style="color:yellow;">`['custom']`</mark> <mark style="color:green;">effect below:</mark>

<pre class="language-lua" data-title="located in effects.lua"><code class="lang-lua"><strong>effects = {
</strong>
    ['stress'] = {
        action = function()
            local amount = 10
            StressEffect(amount)
        end
    },

    ['stamina'] = {
        action = function()
            local duration = 60
            local amount = 1

            StaminaEffect(duration, amount)
        end
    },

    ['speed'] = {

        action = function()
            local duration = 30
            local amount = 1.49     -- 1.49 is the max speed multiplier cant be above this or nothing will happen

            SpeedEffect(duration, amount)
        end
    },

    ['armor'] = {
        action = function()
            local duration = 25
            local amount = 1

            ArmorEffect(duration, amount)
        end
    },

    ['health'] = {
        action = function()
            local duration = 25
            local amount = 1
    
            HealthEffect(duration, amount)
        end
    },

    ['custom'] = {          -- name whatever tf you want
        action = function()
            local duration = 60
            local amount = 1

            -- Do something custom here such as trigger an event or function
            --example: exports['ps-buffs']:AddBuff("hacking", 15000)
        end
    }
}

--- Functions:

StressEffect = function(duration, amount)
    TriggerServerEvent('hud:server:RelieveStress', amount)
end

StaminaEffect = function(duration, amount)
    local ped = PlayerPedId()
    local startStamina = duration
    SetFlash(0, 0, 500, 7000, 500)
    while startStamina > 0 do
        Wait(1000)
        startStamina -= 1
        RestorePlayerStamina(PlayerId(), 1.0)
    end
end

SpeedEffect = function(duration, amount)
    local ped = PlayerId()
    SetRunSprintMultiplierForPlayer(ped, amount)
    Wait(duration*1000)
    SetRunSprintMultiplierForPlayer(ped, 1.0)
end

ArmorEffect = function(duration, amount)
    local ped = PlayerPedId()

    for i = 1, duration do 
        local current = GetPedArmour(ped)
        SetPedArmour(ped, current+amount)
        Wait(1000)
    end
end

HealthEffect = function(duration, amount)
    local ped = PlayerPedId()
    for i = 1, duration do 
        local current = GetEntityHealth(ped)
        SetEntityHealth(ped, current+amount)
        Wait(1000)
    end
end

</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://solos.gitbook.io/solos/joint-roller/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
