# Envi-Addictions

***

## Prerequisites

{% hint style="info" %}

* A working FiveM Server
* Basic understanding of FiveM server setup and resource management
* An up-to-date version of [ox\_lib](https://github.com/CommunityOx/ox_lib)
* Followed the [First Steps](/documentation/premium-scripts/first-steps-read-first.md) guide
* Envi-Bridge (added to your CFX Portal automatically when Addictions is purchased)
* Inventory items that match what you reference in `Config.Addictions`
* The full resource upload, including the packaged `html/` folder
  {% endhint %}

***

## [Tebex](https://envi-scripts.tebex.io/package/6882797)

***

## Features

### 15+ Pre-Configured Addictions

* Drugs
* Behaviors
* Pills
* Gambling
* Crime
* Add unlimited more
  * Add via item names or export
* Envi-Prescriptions and Wasabi Ambulance pre-configured

### Character Effects

* Cravings escalate in realism and intensity
* Progressive Character Deterioration
  * Cravings
  * Shaking
  * Pale Skin
  * Desperation
* Progress from casual use to absolute dependency
* Withdrawls
  * Twitching
  * Coughing
  * Flexing
  * Health loss
  * Stress Gain
  * And add as many more as you would like

### Bulit-In EMS Features

* Stomach Pumping
* Advanced Overdose System
  * Heavy drug use can trigger lethal ODs
* Rehab Zones
  * Fully configurable areas for Treatments or Full Detox
  * You can do some activities, like painting or puzzles, to pass your time in rehab
* Medical Deterioration
  * Drug addicts look like drug addicts
* Realistic Prescription Addictions
  * Mortphine
  * Vicodin
  * Percocet
  * and more...

### Law enforcement and EMS Features

* Blood Testing Stations
  * Job-based access to detect substances
* Forced Rehab System
  * Cops and medics can commit players to rehab for detoxing
* Grade-Based Access
  * Only authorized jobs see test results or commitals
* Custom Rehab Settings
  * Length of stay
  * Cost
  * Access control

### How it works

Envi-Addictions tracks two different values:

* **addiction points** on the server
* **craving points** on the client

That distinction matters.

Addiction points drive:

* addiction level
* treatment and detox outcomes
* the main addiction progress bar

Craving points drive:

* the craving meter
* craving escalation
* craving penalties and pressure

Using a mapped item usually adds addiction points and resets craving pressure for that type.

### Core concepts

#### Addiction points and levels

Each substance stores points in player metadata.

The current level is the highest level threshold the player still meets for that substance.

#### Units consumed in the UI

The monitor can show a `units consumed` style stat.

That is the same tracked point value used for addiction logic.

It is **not** a separate lifetime counter.

#### Under the influence window

Recent intake is tracked server-side for testing and medical checks.

That window is controlled by `Config.UnderTheInfluenceTime`.

#### The bar can stay full at 100%

The main addiction bar is capped against the highest configured threshold for that addiction.

If the player still sits above that top threshold, the bar will stay full until points fall below it.

### Install

1. Follow [FIRST STEPS (READ FIRST)](/documentation/premium-scripts/first-steps-read-first.md).
2. Start your framework, inventory, target, and other dependencies first.
3. Start `envi-bridge` before `envi-addictions`.
4. Upload the complete resource. Do not remove the packaged `html/` folder.
5. Register every item used in `Config.Addictions` and your item-use integration.

### Register these items

Default treatment items are covered on [Inventory Setup](/documentation/premium-scripts/envi-addictions/inventory-setup.md).

At minimum, the default setup expects:

* `syringe_kit`
* `blood_vial`
* `cleanair`
* `cardioclamp`
* `antipsychotix`
* `neurolift`
* `gutflush`
* `zendose`
* `pulsedown`
* `opionix`
* `focuspatch`

If you add new substances in config, add matching inventory items too.

### First-time tips

* Turn `Config.TestCommands` off on live servers.
* Turn `Config.DebugPrints` off on live servers.
* If cravings feel too aggressive, tune the per-substance tables instead of core files.
* `Config.UnderTheInfluenceTime` is in minutes. Set it for your server's RP pace.
* Non-ox inventories must forward item use into the script, or addictions will never increase from item use.

### Docs in this section

* [First Time Setup](/documentation/premium-scripts/envi-addictions/first-time-setup.md)
* [Inventory Setup](/documentation/premium-scripts/envi-addictions/inventory-setup.md)
* [Cravings System](/documentation/premium-scripts/envi-addictions/cravings-system.md)
* [Exports and Commands](/documentation/premium-scripts/envi-addictions/exports-and-commands.md)
* [Medical Workflows](/documentation/premium-scripts/envi-addictions/medical-workflows.md)
* [Rehab, Overdoses, and Blood Testing](/documentation/premium-scripts/envi-addictions/rehab-overdoses-and-blood-testing.md)
* [FAQ and Operations](/documentation/premium-scripts/envi-addictions/faq-and-operations.md)
* [Config File](/documentation/premium-scripts/envi-addictions/config-file.md)

### See also

* [Inventory Setup](/documentation/premium-scripts/envi-addictions/inventory-setup.md)
* [Cravings System](/documentation/premium-scripts/envi-addictions/cravings-system.md)
* [Exports and Commands](/documentation/premium-scripts/envi-addictions/exports-and-commands.md)
* [Medical Workflows](/documentation/premium-scripts/envi-addictions/medical-workflows.md)
* [Rehab, Overdoses, and Blood Testing](/documentation/premium-scripts/envi-addictions/rehab-overdoses-and-blood-testing.md)
* [FAQ and Operations](/documentation/premium-scripts/envi-addictions/faq-and-operations.md)
* [Config File](/documentation/premium-scripts/envi-addictions/config-file.md)

***

## Preview

Coming soon...


---

# 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://envi-scripts-organization.gitbook.io/documentation/premium-scripts/envi-addictions.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.
