Plugin Support
Last updated
Was this helpful?
Last updated
Was this helpful?
This script supports user-made plugins.
Open the root folder of visn_are
, there should be a plugins
folder, open it.
Download the from our github page.
Drag and drop the folder inside the plugins folder.
Now rename the folder to your custom name.
Open the plugin_test_client.lua
and edit the pluginData
.
Do the same for plugin_test_server.lua
.
Now rename the two files to your custom name, but this format is important:
plugin_NAME_TYPE.lua
Type can be: 'server' or 'client' -> It will decide if it will execute on client or server.
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 plugin_test_client.lua
)
Inside of the RegisterClientPlugin
function we will put our logic.
To permanently print a message when our heart rate is below 80, we need a thread
and a while-loop
.
Since everything in the if-statement will only trigger when the heart rate is below 80 we will just print "Low on health!"
inside the statement.
The basic logic is done, but we need to prevent a client-crash so let's implement a Citizen.Wait
-call inside the while-loop
.
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 "Low on health!"
.
After we implemented it, we will access the and do a check if the heart rate is below 80.
Take a look at the .