Creating Your First Script - Abel-Gaming/FiveM-Script-Creator GitHub Wiki

  1. You will want to begin my downloading the FiveM Script Creator if you have not already done so.

  2. After downloading the script creator, open up the program.

  3. After opening the program, in the top left, click File > New Project. If you get the following message, select "Yes"

For this script, we will be creating a script that shows your YouTube channel name when you do /youtube in chat

  1. Place your cursor on line 14, below "Tick += OnTick", like in the image below

  2. Next, at the top, click "Insert" then "Register Command". You will notice some code has been placed on the editor. You might also get a notification box like the following:

  3. Press "OK" on the notification box

  4. Directly below the closing main bracket, paste the code that has been copied to your clipboard (CONTROL + V). Your editor should now look like this

  5. Clean up and format the code if you wish. This will help keep your work organized. Make sure all code is tabbed properly. [THIS STEP IS OPTIONAL]

  6. Now, in the private static void CommandAction area, we are going to do the code that will happen when /youtube is entered in the chat.

  7. We will begin by placing our cursor the line under "//COMMAND CODE GOES HERE" like so:

  8. Now we will go back to the "Insert" section at the top, select "Screen", then select "Show Notification"

  9. You will notice some code has been added to the editor. Replace "NOTIFICATION TEXT GOES HERE" with your YouTube name or link.

  10. You are now ready to export your script. Do so by going to File > Compile Mod > Name your mod when the save dialog appears, but be sure to put .net after the name. Please note that the name cannot contain spaces.

  11. Click save. You have created your mod. The code for the __resource.lua and the code for the project can be found in the code section of this Github in the folder, "Creating Your First Script"

Video Tutorial: https://www.youtube.com/watch?v=_w_p5c8f5Ok