> For the complete documentation index, see [llms.txt](https://docs.veryinsanee.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.veryinsanee.space/advanced-roleplay-environment/plugin-support.md).

# Plugin Support

This script supports user-made plugins.

## How to create a custom plugin

### Basic Preparation

1. Open the root folder of <mark style="color:yellow;">`visn_are`</mark>, there should be a <mark style="color:yellow;">`plugins`</mark> folder, open it.
2. Download the [sample plugin](https://github.com/veryinsanee/visn_are_sample_plugin) from our github page.
3. Drag and drop the folder inside the plugins folder.
4. Now rename the folder to your custom name.
5. Open the <mark style="color:yellow;">`plugin_test_client.lua`</mark> and edit the <mark style="color:yellow;">`pluginData`</mark>.
6. Do the same for <mark style="color:yellow;">`plugin_test_server.lua`</mark>.
7. Now rename the two files to your custom name, but this format is important:
   1. <mark style="color:yellow;">`plugin_NAME_TYPE.lua`</mark>
   2. Type can be: 'server' or 'client' -> It will decide if it will execute on client or server.

### Let's create our own content!

Let's create a plugin that prints a message when our heart rate is below 80.

Since this will be a client-side-plugin, we will open our client-side plugin file. (In this case <mark style="color:yellow;">`plugin_test_client.lua`</mark>)

Inside of the <mark style="color:yellow;">`RegisterClientPlugin`</mark> function we will put our logic.

To permanently print a message when our heart rate is below 80, we need a <mark style="color:yellow;">`thread`</mark> and a <mark style="color:yellow;">`while-loop`</mark>.

![](/files/ScG53o7ZqwVNLPlmKd6E)

After we implemented it, we will access the [client health buffer](/advanced-roleplay-environment/api-reference.md#client) and do a check if the heart rate is below 80.

![](/files/B5sQZsyaZBBQ9kH6hLAg)

Since everything in the if-statement will only trigger when the heart rate is below 80 we will just print <mark style="color:yellow;">`"Low on health!"`</mark> inside the statement.

The basic logic is done, but we need to prevent a client-crash so let's implement a <mark style="color:yellow;">`Citizen.Wait`</mark>-call inside the <mark style="color:yellow;">`while-loop`</mark>.

![](/files/BCnib3JlBiJXSbZXtXIB)

### **We are done!**&#x20;

After the resource has been started (or restarted) the plugin will load.

Now when are ingame and the heart rate is below 80, the console is getting spammed with <mark style="color:yellow;">`"Low on health!"`</mark>.

![](/files/3WuRjK4PO5OvUyO9eJCU)

## Questions

<details>

<summary>Which functions can I use?</summary>

Take a look at the [API Reference](/advanced-roleplay-environment/api-reference.md).

</details>
