How to Create Money as Item in QBCore - QBCore Guide for FiveM
Introduction
This tutorial turns How to Create Money as Item in QBCore into a clean, developer-friendly guide for QBCore/FiveM. You will follow a step-by-step flow, copy the relevant code patterns, and learn the “why” behind the setup.
Requirements
- QBCore installed and running on a dev server
- Basic Lua knowledge and comfort reading FiveM patterns
- A test workflow for iterating safely (dev server, not production)
- Optional: a code editor with Lua/FiveM helpers (VS Code recommended)
Step-by-Step Guide
Step 1: Overview
In this step, you will apply the overview concept as a practical change: define the pieces, wire them together, then verify the behavior in your dev server.
Step 2: Prerequisites
In this step, you will apply the prerequisites concept as a practical change: define the pieces, wire them together, then verify the behavior in your dev server.
Step 3: Step 1: Configure Money Items
In this step, you will apply the step 1: configure money items concept as a practical change: define the pieces, wire them together, then verify the behavior in your dev server.
Step 4: Edit qb-core/shared/items.lua
In this step, you will apply the edit qb-core/shared/items.lua concept as a practical change: define the pieces, wire them together, then verify the behavior in your dev server.
Step 5: Step 2: Create Money Conversion Functions
In this step, you will apply the step 2: create money conversion functions concept as a practical change: define the pieces, wire them together, then verify the behavior in your dev server.
Step 6: Server-Side Functions (qb-core/server/functions.lua)
In this step, you will apply the server-side functions (qb-core/server/functions.lua) concept as a practical change: define the pieces, wire them together, then verify the behavior in your dev server.
Step 7: Step 3: Create Useable Items
In this step, you will apply the step 3: create useable items concept as a practical change: define the pieces, wire them together, then verify the behavior in your dev server.
Step 8: Make Cash Items Useable
In this step, you will apply the make cash items useable concept as a practical change: define the pieces, wire them together, then verify the behavior in your dev server.
Code Example
-- Money Items
['cash'] = {
name = 'cash',
label = 'Cash',
weight = 0,
type = 'item',
image = 'cash.png',
unique = false,
useable = false,
shouldClose = false,
combinable = nil,
description = 'Paper money'
},
['markedbills'] = {
name = 'markedbills',
label = 'Marked Bills',
weight = 1000,
type = 'item',
image = 'markedbills.png',
unique = true,
useable = false,
shouldClose = false,
combinable = nil,
description = 'Money with serial numbers'
},
['dirtymoney'] = {
name = 'dirtymoney',
label = 'Dirty Money',
weight = 1000,
type = 'item',
image = 'dirtymoney.png',
unique = true,
useable = false,
shouldClose = false,
combinable = nil,
description = 'Illegally obtained money'
}Tips & Best Practices
- Keep authority on the server: validate inputs before money/database operations.
- Start with one resource/module at a time, then refactor after you verify it works.
- Use callbacks for request/response flows and events for push/UX updates.
- When you run loops, avoid freezes: always yield with Wait() (client/server) and cache hot values.