# Adding infusions

*Advanced Roleplay Environment supports modular* infusion&#x73;*. This means you can easily add medications or edit them accordingly.*

## Adding infusions

In order to add a infusion we just need to add the infusion inside the infusions file and configure the properties accordingly.

### Adding the infusion

Since all infusion are saved inside <mark style="color:yellow;">`script/entities/infusions.lua`</mark>, we will open this file. This should look like this:

<figure><img src="/files/1MmKGU8LNW1KDR8XnKLa" alt=""><figcaption><p>script/entities/infusions.lua</p></figcaption></figure>

Now we will scroll to the bottom and just copy a infusion from above and edit it to our needs so it should look like this:

<figure><img src="/files/DJWdY8OdUTxBujHpn92O" alt=""><figcaption><p>script/entities/infusions.lua</p></figcaption></figure>

### Configuring the infusion

There are many options available for us to configure the infusion perfectly to our needs.

<table><thead><tr><th width="248.33333333333331">Option</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>availableVolumes</td><td>This property is a table and contains all volumes that will be created and displayed in the ui.</td><td><code>availableVolumes = { 100, 200 }</code><br>Using it like this will produce two volumes: One with 100 milliliters and one with 200 milliliters.</td></tr><tr><td>cooldown</td><td>This property is a number and contains the value of how long the action takes to apply this infusion via the ui.  </td><td><code>cooldown = 10</code><br>The action has a duration of 10 seconds.</td></tr><tr><td>ivChangePerSecond</td><td>This property is a number and contains value of how much of the infusion will be removed/processed per second.</td><td><code>ivChangePerSecond = 3</code><br>The infusion will process 3 milliliter per second. So if 100 milliliters is our volume the infusion has gone trough after ~34 seconds (100ml / 3ml/s).</td></tr><tr><td>onTick</td><td>This property is a function and will be triggered every second.</td><td><code>onTick = function(clientData, healthBuffer, bodyPart, ivChange, totalVolume)</code><br><code>print("hello")</code><br><code>end</code><br>Using it like this the infusion would print "hello" every second in the console.</td></tr><tr><td>onFinish</td><td>This property is a function that will be executed when the infusion has gone trough.</td><td><code>onFinish = function(clientData, healthBuffer, bodyPart, ivChange, givenVolume)</code><br><code>print("finished")</code><br><code>end</code><br>Using it like this the infusion would print "finished" in the console when it has gone trough.</td></tr></tbody></table>

### Adding the translation

Since the translation is missing it will look weird inside the ui. So we need to add it in our locale files. So we open our locale file (example: languages/en.json) and copy 'n' paste just an other entry and edit the values accordingly. So it should look like this if added like [above](#adding-the-infusion):

<figure><img src="/files/6Ouow3dCz2NFNLJ7skyH" alt=""><figcaption></figcaption></figure>


---

# 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://docs.veryinsanee.space/advanced-roleplay-environment/guides/advanced-configuration-guide/adding-infusions.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.
