how to create resource fivem

How to create Resource Fivem

New guide about the process of how to create a basic resource on fivem. Let’s get started with this guide!
ZAP-Hosting Gameserver and Webhosting

Requirements

In order to create a resource on fivem you need to have a test server, you can find a guide here for windows or here for linux. Another important thing you should have is VSCode, or any other code editor.

Creation of the resource

The creation of a resource on fivem is pretty simple. Open your resource folder which may be located in: “cfx-server-data > resource”. And here create your folder, with the name you want. Now navigate inside of it and create another filenamed: “fxmanifest.lua” here you will place a lot of important information about your script, such as who’s the author, the version of it, which manifest and for which game it can be used (resources are structured the same on redm and fivem). Here is an example

-- Defines games requirement
fx_version 'cerulean'
games { 'gta5' }

-- Defines author and script info
author 'gatu.wiki'
description 'Resource example made by gatu.wiki'
version '1.0.0'

-- Web page can be self hosted or used on a webserver
ui_page '/html/index.html' 
-- ui_page 'https://gatu.wiki'


-- Files to be loaded used in other script, but not used on the client side directly
files {
    '/html/app.js',
    '/shared/vehicles.json'
}

-- File/s to be loaded on both client-server side
shared_file 'config.lua'

-- Define which scripts need to be loaded on the client side
client_scripts {
    '/client/client.lua',
    '/client/client_two.lua'
}

-- Define which scripts need to be loaded on the client side
server_script 'server.lua'

This is what the content of your manifest will look like. Note:

  • If you need to add more scripts: “client_script” or “server_script” or “shared_script” or similar just add and “s” in the end and make sure to put your files inside: “{}” so the game will load them.
  • The fx_version or the game property can be changed into whatever you need.

And this is all, this guide about how to create a resource on FiveM is over. If you are interested in creating a NUI take a look here and make sure to join our discord here. Take care and see you in the next guide.

About rikk228js

Developer - Writer