# Trees

* You can add more harvestable trees by defining the item name and its relevant information in the Config.Trees table
* The `key` is the harvested item name

```lua
Config.Trees = {
    ['item_name_rewarded'] = { -- the key is the item name given from harvesting
        ---
    },
}
```

***

{% hint style="warning" %}
Info
{% endhint %}

* Icon is the target icon for the prop
* Label is the target label for the prop
* Distance is the target distance for the prop bare in mind the number you set for MaxDistance in Security settings

```lua
info = {
    icon = 'fa-solid fa-hand-point-up', -- target icon
    label = 'Harvest Item', -- target label
    distance = 3.0, -- target distance
},
```

***

{% hint style="warning" %}
Prop
{% endhint %}

* Name is the prop model you want to use for this item

```lua
prop = {
    name = 'prop_tree_birch_05', -- prop name
},
```

***

{% hint style="warning" %}
Required Item
{% endhint %}

* You can set the prop to have a required item to harvest
* Set enabled to true to use a required item
* Name is the item name

```lua
item = {
    required = true, -- enable a required item to harvest
    name = 'basket', -- item name
},
```

***

{% hint style="warning" %}
Blip
{% endhint %}

Blip information can be found here: [https://docs.fivem.net/docs/game-references/blips/](https://docs.fivem.net/docs/game-references/blips/)

* You can enable blips for each prop that spawns
* Set enabled to true to use blips
* Define the blip id
* Define the blip colour
* Define the blip scale
* Define the blip title

```lua
blip = { -- define blip settings
    enabled = true, -- enable blip for this location
    id = 836, -- blip id
    colour = 47, -- blip colour
    scale = 0.7, -- blip scale
    title = 'Orange Trees', -- blip title
},
```

***

{% hint style="warning" %}
ProgressCircle
{% endhint %}

* Define progressCircle settings for harvesting
* Duration is the time to harvest
* Label is the progressCircle label
* animation table - anim is animation name, dict is animation dictionary name, flag is animation flag
* prop table - model is prop name, bone is bone index for prop, pos is prop position, rot is prop rotation

```lua
progress = {
    duration = 10000, -- duration
    label = 'Harvesting oranges', -- label
    anim = { -- define animation settings
        anim = 'amb@prop_human_movie_bulb@base', -- animation name
        dict = 'base', -- animation dict name
        flag = 49, -- flag number
    },
    prop = {
        model = 'prop_fruit_basket', -- prop model
        bone = 18905, -- bone index
        pos = vec3(0.13, 0.0, -0.27), -- prop position
        rot = vec3(0.0, 0.0, 0.0), -- prop rotation
    },
},
```

***

{% hint style="warning" %}
Coords
{% endhint %}

* Define coordinates for the props to spawn at these must be `vector4`

```lua
coords = { -- object spawn coords must be vector4
    vector4(5053.86, -4857.34, 18.68, 189.71),
    vector4(5056.02, -4863.24, 18.33, 229.12),
    vector4(5062.71, -4868.62, 18.18, 230.1),
    --add more locations as required
},
```

***

{% hint style="success" %}
Finished Config
{% endhint %}

* This is an example of a finished config for a harvestable item

```lua
Config.Trees = {
    ['orange'] = { -- the key is the item name given from harvesting
        info = {
            icon = 'fa-solid fa-hand-point-up', -- target icon
            label = 'Harvest Oranges', -- target label
            distance = 3.0, -- target distance
        },
        prop = {
            name = 'prop_tree_birch_05', -- prop name
        },
        item = {
            required = true, -- enable a required item to harvest
            name = 'basket', -- item name
        },
        blip = { -- define blip settings
            enabled = true, -- enable blip for this location
            id = 836, -- blip id
            colour = 47, -- blip colour
            scale = 0.7, -- blip scale
            title = 'Orange Trees', -- blip title
        },
        progress = {
            duration = 10000, -- duration
            label = 'Harvesting oranges', -- label
            anim = { -- define animation settings
                anim = 'amb@prop_human_movie_bulb@base', -- animation name
                dict = 'base', -- animation dict name
                flag = 49, -- flag number
            },
            prop = {
                model = 'prop_fruit_basket', -- prop model
                bone = 18905, -- bone index
                pos = vec3(0.13, 0.0, -0.27), -- prop position
                rot = vec3(0.0, 0.0, 0.0), -- prop rotation
            },
        },
        coords = { -- object spawn coords must be vector4
            vector4(5053.86, -4857.34, 18.68, 189.71),
            vector4(5056.02, -4863.24, 18.33, 229.12),
            vector4(5062.71, -4868.62, 18.18, 230.1),
            vector4(5070.86, -4870.8, 18.12, 266.84),
            vector4(5077.95, -4873.65, 17.58, 197.98),
            vector4(5086.21, -4870.11, 16.88, 292.07),
            vector4(5082.86, -4865.08, 17.15, 29.5),
            vector4(5077.06, -4859.16, 17.64, 50.37),
            vector4(5070.82, -4854.89, 18.18, 55.11),
            vector4(5065.29, -4849.77, 18.57, 36.85),
            vector4(5065.29, -4849.77, 18.57, 36.85),
            vector4(5066.87, -4861.1, 18.39, 66.27),
            vector4(5061.43, -4855.02, 18.62, 234.21),
            vector4(5054.74, -4850.41, 18.97, 58.65),
            vector4(5059.07, -4844.7, 18.82, 310.47),
            vector4(5065.04, -4839.3, 18.39, 304.83),
            vector4(5073.08, -4843.52, 17.83, 215.73),
            vector4(5079.13, -4850.48, 17.31, 222.63),
            vector4(5086.74, -4856.15, 16.42, 234.46),
            vector4(5091.84, -4862.61, 16.0, 137.5),
            --add more locations as required
        },
    },
    --add more harvestable plants as required below
}
```
