Skip to content
rpcrate
RPCrate Docs

Install a script on QBCore

Start order, shared items, jobs and common pitfalls when you install an RPCrate 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-core and oxmysql run on your server. Install any other dependencies from the product description, often ox_lib and qb-target or ox_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:

server.cfg
ensure oxmysql
ensure ox_lib
ensure qb-core
ensure [qb]

ensure resource_name

Add 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:

qb-core/shared/items.lua
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

SymptomLikely 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 imageThe 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 appearThe config targets qb-target but your server runs ox_target, or the other way around.

More: Startup errors, Install and test QBCore scripts.