Onforum.net - Web and gaming resource community

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members .

FiveM [How-to] Install a FiveM resource / Script

Sonia

Administrator
Administrator
Credits
1,338
this may be a very basic thing to do, but this tutorial is more aimed at beginner’s and people that are new to the FiveM world.

Current things this tutorial covers;

Code:
Basic script with a server.lua and client.lua
Map Resources
Making a __resource.lua
Weapon Resources

TO COME:
Bigger resources with many client and server files
UI Related resources
Vehicle Resources
Video Tutorials for each tutorial
Some may be thinking, ‘why do you have a server if you know nothing’, well we all have to start somewhere.

Making a __resource.lua
A __resource.lua is the file which loads all the contents of a resource, whether it being a script, map, vehicle etc. These files are required for a resource to work. This tutorial will cover how to make a resource.lua for a resource. You may follow this for the below tutorials

  1. Create your lua file. Open a new text file using notepad, notepad++ or any other similar program. On the first line place your resource manifest version (optional, but recommended) you can find resource manifests here 4.8k. Your line in your file should look like the below; Note the version may be different, use the link above.
Code:
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'
Now the next part is where you can load the script. A client_script is used for client.lua’s and a server_script is used for a server.lua. Below is a list of common ways to start the script.
Code:
client_script
server_script
ui_page
file
Find which of the above you need and start your next line and add your script file name. Eg;
Code:
client_script "client.lua"
Make sure to include the quotes ( " ) and the space in the above

3A. if your file is in a folder (Eg; /ui/client.lua) make sure to include the directory so it looks like
Code:
client_script "ui/client.lua"
Do this for all files that need to be loaded. So the end result could look similar to the below:
Code:
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'

ui_page 'ui/index.html'
files {
  'ui/index.html',
  'ui/style.css',
  'ui/img/logo.png',
  'ui/script.js'
}

client_script "client.lua"
or
Code:
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'

client_script "client.lua"
server_script "server.lua"
  1. Now you should be done. Make sure you have all quotation marks and all spelling and directory’s are correct.
End Tutorial

Basic Script
With __resource.lua, client.lua & server.lua
Video - https://youtu.be/BEzVqRaVQMY 882

  1. As with most resources they come from a rar or zip file, In these compressed files may be a folder
    or files. Most resource contents should look like the below image:
9d278b538ccfca81e111e929f7ee7caaf2c3ced2.PNG

These files are the common files for resources, sometimes the names of client.lua and server.lua may be changed or you could have a config file.

So first you will want to have these files (in above image) in a folder, some may be inside a folder in the rar or zip file. For a basic script like this you should be able to rename it unless it contains java or (N)UI files.

  1. Upload this folder in to your resources folder on your server. In the image below I’m using a VPS server. In your server a common spot can be server-data/resources You should have the default resources the FiveM dev’s have made, if not go to the below link. Upload it in to your resources folder.

Now after you have uploaded the folder in to your resources folder now go back to the main server folder (should contain a cache folder and server.cfg ) Now open the server.cfg file. It should look like this:

05b2827d321a1c1eb9c72e92c2497cf34c2f7d29.PNG

PS; You should have ‘start hardcap’ and ‘start sessionmanager’ as well

Now at the bottom of the start’s add start FolderName (Replace FolderName with the folder name you have)

It should now look like this;

Code:
start mapmanager
start chat
start spawnmanager
start sessionmanager
start fivem
start hardcap
start ■■■■■■■
start scoreboard
start FolderName
  1. Now restart your server and the resource will automatically start when the server starts.
    4a. If you don’t want it to automatically starts take this line out of the start list and you can start it via console, ingame or rcon using - start FolderName
End Tutorial

Map Resource
Video - https://youtu.be/UzeGqyScLWI 1.4k

  1. Map resources can be the easiest resources to make. 1st make a __resource.lua and place the manifest. You can find resource manifests here 4.8k.
  2. Place the manifest version at the top of your __resource.lua. It should look like this:
Code:
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'
Version might be different

  1. Now add this_is_a_map ‘yes’. This now tells the server that these is a map resource and to stream the folder (next step).
  2. Now in your resource add a folder called stream. Your resource should look like the below image
2bd7dee1b01faf6808bd37f8419e085fd7009326.PNG

  1. Place any .ymap file(s) (map files) into the stream folder and start your resource. *You can automatically start them on server startup using start ResourceName.
For example maps for FiveM take a look here 2.0k

End Tutorial
Weapon Resources
This (weapon) tutorial is to show you how to install a weapon modification into FiveM.

  1. Download or get your weapon mod handy. A great place to get weapons is from GTAV-mods.com 187
  2. Make a new folder for a resource and make a __resource.lua and leave it empty. Note; you can place weapons folder inside another resources stream folder.
  3. Inside your new resource make a stream folder followed by a weapons folder (FolderName>Stream>Weapons). Place all your weapons inside the stream folder (see below)

75cdb96ec3f3762c196722c83e200cd7ea907e3a.PNG


  1. Now you should be done restart your server and clear cache.
End Tutorial
 
Top

Dear User!

We found that you are blocking the display of ads on our site.

Please add it to the exception list or disable AdBlock.

The advertises that you'll see aren't intrusive they just help us to keep the community alive

If you don't want to see those ads just buy an upgrade.

Thank you for understanding!

Rogue

Rogue Purchase

User upgrade! at

🔥 Upgrade Now
Baba2

Baba2 Purchase

User upgrade! at

🔥 Upgrade Now

Escanor25 Purchase

User upgrade! at

🔥 Upgrade Now