> For the complete documentation index, see [llms.txt](https://codestudio5m.gitbook.io/codestudio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codestudio5m.gitbook.io/codestudio/our-scripts/drug-selling-+-level-based/setup.md).

# Setup

This is a detailed setup guide for Drug Selling + Level Based Script. If you have any questions before making a purchase, you can contact us on Discord

## Setting Up the Script

1. Script Supports QB and ESX Frameworks Only

2. Script Support <mark style="color:green;">qb-target, ox\_target</mark>&#x20;

3. You can configure drug dealer UI opening either by using a command or an item\
   ![](https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2FzylgRbgyQwZBce6vPHYR%2Fimage.png?alt=media\&token=fabfed64-e99e-4165-9128-aa85a9c2def0)

4. <mark style="color:orange;">CodeStudio.MaxLevel</mark> is Max Drug Level that a player can reach and <mark style="color:orange;">CodeStudio.XPNeedToLevel</mark> is How much XP each level contains (Ex. 100XP = 1 Level)

5. <mark style="color:orange;">CodeStudio.PriceChangeAtNight</mark> It will multiply drug selling prices at night (Disable is 0)

6. <mark style="color:orange;">CodeStudio.MaxQSellDrug</mark> is the Maximum Quantity of Drug, Player can sell at one time to NPC

7. You can set Ped Steal and Cops calling chance like this: \ <img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2F4QWCiv5j30VBji7hqW4m%2Fimage.png?alt=media&amp;token=3c94bd21-1ea5-48dc-a9f5-529f26b07e8d" alt="" data-size="original">

8. You can Blacklist Drug selling peds by adding peds like this: \
   ![](https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2FsOkiz7paNz2zec7dOtfu%2Fimage.png?alt=media\&token=68fc6e5d-ff58-4717-9b0a-d7e00f1ed0b8)\
   For Ped Models Refer: <https://docs.fivem.net/docs/game-references/ped-models/>

9. You can customize animations in the config

10. Drug Selling Rewards can be configured between cash/bank or any item\ <mark style="color:orange;">`CodeStudio.Reward_Type = 'cash' --'cash/bank/item_name'`</mark>

11. Configurable Admin Command to manage XP System<br>

    <figure><img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2FbbAVrWhEFNAxr82b68cL%2Fimage.png?alt=media&amp;token=1ae65b3b-80ce-4b3d-b4ee-72fdd415e555" alt=""><figcaption></figcaption></figure>

12. You can add your own police dispatch system Examples are given in the config itself

13. Add Drug Zones and Customise Levels<br>

    <figure><img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2F9CDX7agQ01zN3umm2xBV%2Fimage.png?alt=media&amp;token=dfe5fc2f-4355-4fdd-9791-0d11d1cadea2" alt=""><figcaption><p><mark style="background-color:green;"><strong>Example is Given in the Config</strong></mark></p></figcaption></figure>

14. Put Drug Item Images in *<mark style="color:purple;">**cs\_selldrug/ui/assets/img**</mark>*  so they can appear in the UI

15. Customize Drug Selling List with XP and random Prices

    <figure><img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2F6nR1cd3Y7BPBEwDNoDlo%2Fimage.png?alt=media&amp;token=fd65666a-d9fc-405b-b87f-85d976450564" alt=""><figcaption></figcaption></figure>

## Events and Exports

### Client Side

1. <pre class="language-lua" data-title="Open Drug Dealer UI "><code class="lang-lua">TriggerEvent('cs:selldrug:openUI') 
   </code></pre>

#### <br>
