Skip to content

Making your first script ​

In this introduction you will learn how make your very own Voidline script. With scripts you are a able to create your very own module for voidline using lua and the libs!

Scripting in voidline is very new so make sure to leave suggestion in the #suggestions channel in discord!

Getting ready to start writing code: ​

It's recommended to download a code editor although you can use any text editor. we recommend Visual Studio Code:

  • download and install Visual Studio Code here: https://code.visualstudio.com/
  • After installing open it and click on the extensions tab (bottom most icon on the sidebar)
  • Search and install the Lua extension by sumneko (should be the first search result when you search for lua)

Opening the scripts folder ​

Now that we have our code editor setup lets open the scripts folder:

  • In visual studio code click the Explorer tab (the top most icon) and click open repository
  • navigate the the scripts folder by pasting this: %appdata%\Voidline\Scripts in the file location bar at the top press enter and click Select folder

Creating the script file ​

Before you can write your code we first need to create the script file we will putting the coding in.

  • navigate to the Explore tab (top most icon on the left sidebar)
  • next to where it says SCRIPTS on the right click the left most icon which is used to create a new file
  • type the name of the script (should be unique) ending with .lua (important!)
  • press ENTER

Nice now we have a new file to start coding your first script in!

Writting some code ​

to start we are going to configure same basic things:

add this at the top of your script and edit the name and description

c
name = "Some awesome name"
description = "A very cool discription, trust."

now you have to decide if you are making a drawable/hud module like cps counter fps counter coordinatees etc if you are add

c
drawable = true

onEvent("onRenderEvent", function ()
    Render.drawModule("Hello world!")
end)

else

c
drawable = false

and that it! You can now have a look at the libs and events to see what our api has to offer and start scripting!