Fundamentals: your first resource in QBCore · Lesson 1/5 · 7 min

What a resource is and how to import QBCore

A resource is a folder with an fxmanifest.lua. Here you learn how to structure it and hook it into QBCore.

In FiveM everything you add to your server is a "resource": a folder inside resources/ with an fxmanifest.lua. That manifest tells the server which scripts to load and in which context (client, server or shared). On a QBCore server, additionally, your resource needs the core (qb-core) to be loaded first.

The minimal structure

text
resources/
└── [custom]/
    └── mi_primer_script/
        ├── fxmanifest.lua
        ├── client.lua
        └── server.lua

Resource folder

The fxmanifest.lua with QBCore

lua
fx_version 'cerulean'
game 'gta5'

author 'YourName'
description 'My first QBCore resource'
version '1.0.0'

-- QBCore is obtained via export, no need to import it in shared,
-- but you DO need to declare it as a dependency for load order:
shared_scripts {
  'config.lua',
}

client_scripts {
  'client.lua',
}

server_scripts {
  'server.lua',
}

dependency 'qb-core'

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: load on both sides (ideal for config.lua).
  • dependency 'qb-core': ensures the core starts before your resource.

To enable it, put it in resources/[custom]/ and add ensure mi_primer_script to your server.cfg AFTER ensure qb-core. Reload with refresh + ensure mi_primer_script.

Practice what you learned

0/3
Test

¿Qué es un «recurso» en FiveM?

Rellena los huecos

Completa la línea del fxmanifest que garantiza que el core arranca antes que tu recurso.

1client_scripts {
2 'client.lua',
3}
4
5server_scripts {
6 'server.lua',
7}
8
9 'qb-core'
Pista

No se importa qb-core en shared_scripts; se declara como dependencia para fijar el orden de carga.

Test

¿En qué se diferencian client_scripts y server_scripts?

Challenge: code it yourself

Create an fxmanifest.lua for a QBCore resource called "taxi_job" with client.lua, server.lua and a shared config.lua, declaring qb-core as a dependency.

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', the three script lists and dependency 'qb-core'.

Escribe aquí tu solución:

How was this lesson?