Skip to main content

2 - Your First Weapon Script

In this section, you will learn how to create your very first Weapon Script in GraalScript2: a simple "Hello World" script.

Step 1: Open the Weapon Scripts Menu

  1. Open the Weapon Scripts menu in your game.
  2. Click on the Add button.
  3. Enter the name of your script as Test.
  4. Click Add again to create the script.

This will open the code editor where you can start writing your script.

Code Editor

Step 2: Create Your Script

In the code editor, type the following code:

function onCreated() {
echo("Hello World!");
}

This script will display "Hello World!" into RC chat when your weapon script is saved.

Hello World Script

Congratulations! You have successfully created your first Script.