Install a script on QBCore
Start order, shared items, jobs and common pitfalls when you install an RPScripts script on a QBCore FiveM server.
This page adds the QBCore-specific steps to the general installation. Background on the framework itself: QBCore framework guide.
Requirements
- The product page shows the QBCore badge.
qb-coreandoxmysqlrun on your server. Install any other dependencies from the product description, oftenox_libandqb-targetorox_target.
Start order
qb-core must start before every QBCore script. The default QBCore server.cfg starts the whole [qb] folder; start your own scripts after it:
ensure oxmysql
ensure ox_lib
ensure qb-core
ensure [qb]
ensure resource_nameAdd the items
Scripts that use items list them in their readme. In QBCore, items are registered in qb-core/shared/items.lua. Copy each entry into the table, keeping the format of the existing entries in your file:
example_item = {
name = 'example_item',
label = 'Example Item',
weight = 100,
type = 'item',
image = 'example_item.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Example'
},Copy the item images into your inventory's image folder (for qb-inventory: qb-inventory/html/images/). Restart the server afterwards: shared items are read when qb-core starts.
If your server uses ox_inventory, the items go into ox_inventory/data/items.lua instead. See Qbox for that format.
Add jobs and gangs
Job scripts often need a job entry in qb-core/shared/jobs.lua (gangs: shared/gangs.lua). Use the exact job name the script's config expects.
Common QBCore problems
| Symptom | Likely cause |
|---|---|
attempt to index a nil value (global 'QBCore') | The script starts before qb-core, or it uses an old way of getting the core object. Check the start order first. |
| Item cannot be used or shows no image | The item is missing from shared/items.lua, the name differs, or the image is not in the inventory's image folder. |
| Target options do not appear | The config targets qb-target but your server runs ox_target, or the other way around. |
Check compatibility before you buy
How to read the framework, dependency and version details on an RPScripts product page so the resource fits your FiveM server.
Install a script on ESX
Start order, database items, jobs and common pitfalls when you install an RPScripts script on an ESX (es_extended) FiveM server.