> For the complete documentation index, see [llms.txt](https://kevingirardx.gitbook.io/scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kevingirardx.gitbook.io/scripts/cornerselling.md).

# Cornerselling

<figure><img src="/files/nN3u4gl7CBZqp1OFDYo8" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/glHlJk90X2sKIam1PObg" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Dependencies:

Renewed Lib: <https://github.com/Renewed-Scripts/Renewed-Lib/releases/tag/v2.0.7>

Ox Lib: <https://github.com/overextended/ox_lib/releases>

Bl Dialog: <https://github.com/Byte-Labs-Studio/bl_dialog>
{% endhint %}

{% hint style="success" %}
Supports:

* QBox, QBCore, Esx (using ox inventory)
* Qb-target, ox target
  {% endhint %}

{% hint style="info" %}
Features:

* Zones based selling
* Each zone can have any item set to be sold within
* Maximum number of sellers allowed to sell within a zone
* Price cuts for items if maximum number or sellers are over
* Prices for the items are very dynamic and wont ever be the same
* Counter offers
* Percentage increase of items price if counter offer is met
* Police alert chance based on the item being sold
* Customer intervals based on item being sold
* Any item can be added to be sold
  {% endhint %}

### Zone Example

```lua
['Grove Street'] = {
    zone = {
        points = {
            vec3(-155.5, -1783.0, 30.0),
            vec3(94.0, -2030.5, 30.0),
            vec3(381.0, -2162.0, 30.0),
            vec3(467.0, -2063.0, 30.0),
            vec3(52.5, -1679.5, 30.0),
        },
        thickness = 53.5,
    },
    sellables = {
        weed_amnesia = {
            policeAlertChance = 0.1,                       -- chance to alert police per item sold
            customerInverval = { min = 2000, max = 4000 }, -- time in ms between customers
            price = 150,                                   -- price per item
            amount = { min = 1, max = 3 },                 -- amount of items per customer
            minSellAmount = 5,                             -- minimum amount allowed to start the selling
        },
    },
    sellers = {
        max = 5,        -- maximum number of sellers allowed in this zone before it becomes too crowded and price drops
        priceCut = 0.1, -- percentage of the selling price the server takes
    },
    counterOffer = {
        successChance = 0.1,
        percentageIncrease = 0.2, -- percentage increase in the counter offer
    },
},
```

### Zone Creation

{% hint style="danger" %}
Zone creation is done through ox lib by using the zone creator\
<https://coxdocs.dev/ox_lib/Modules/Zones/Shared#zone-creation-script>
{% endhint %}
