Fundamentals: your first resource · Lesson 1/6 · 7 min
What a resource is and how it's structured
A resource is a folder with an fxmanifest.lua that tells FiveM which files to load and where.
In FiveM, everything you add to your server is a «resource»: a folder inside resources/ with a special file called fxmanifest.lua. That manifest is the index that tells the server which scripts to load and in which context (client, server or shared).
The minimal structure
resources/
└── mi_primer_script/
├── fxmanifest.lua
├── client.lua
└── server.luaResource folder
The fxmanifest.lua
fx_version 'cerulean'
game 'gta5'
author 'TuNombre'
description 'Mi primer recurso'
version '1.0.0'
-- Runs on the client (each player's PC)
client_scripts {
'client.lua'
}
-- Runs on the server (your machine, trusted)
server_scripts {
'server.lua'
}
-- Shared by both (configuration, data)
shared_scripts {
'config.lua'
}fxmanifest.lua
- client_scripts: run on each player's PC. They are NOT trusted.
- server_scripts: run on your server. They are the authority.
- shared_scripts: loaded on both sides (ideal for config.lua).
To activate your resource, put it in resources/ and add ensure mi_primer_script to your server.cfg. Then reload it with refresh + ensure mi_primer_script in the console.
Challenge: code it yourself
Create an fxmanifest.lua for a resource called «taxi_job» that loads a client.lua, a server.lua and a shared config.lua.
Write it yourself in your editor (VS Code) and test it on your server. You learn here by doing it, not by copying.
See hint
Use fx_version 'cerulean', game 'gta5' and the three script lists.
Escribe aquí tu solución:
