FreeScriptQBoxQBCore
learn-fivem
by SamMethot · version 2026.07.24 · updated 3 days ago
No reviews yet
- Downloads
- 0
- Reviews
- 0
- Size
- 140 KB
- Code check
- Clean
- Licence
- MIT
- Released
- Nov 2026
Beginner-to-shipping FiveM coding course. Lua, NUI, security, performance. Every line annotated.
FiveM School
Searchable, themed, with a navigation tree and copy-paste code buttons. Same content, nicer to read.
If you've ever opened a FiveM resource on GitHub and felt lost - this fixes that.
Who This Is For
You'll get the most out of this if you:
What You'll Be Able To Build
By the end:
Thing, Why
PC with FiveM installed, You can't test without playing
Code editor (VS Code recommended), Syntax highlighting, file explorer, terminal
Local FiveM dev server (txAdmin is the easiest), You need a server to load your code into
Basic Git (GitHub Desktop if you hate the command line), To version-control your work
A MySQL client (HeidiSQL on Windows, DBeaver cross-platform), To poke at the database
VS Code extensions worth installing day one:
Read in order. Each folder builds on the last. Skipping = confusion later.
Each lesson ends with **
If you feel lost, jump to [
How Each Lesson Is Structured
Every lesson follows the same shape so you know what to expect:
Every non-trivial line gets a comment. You shouldn't have to guess what any line does.
Core Rules (Memorize These)
These come back in every lesson. Burn them in now:
Most examples target the modern FiveM roleplay stack. If your server differs, adapt - the core concepts stay identical.
Thing, What we use, Common alternative
Framework, [Qbox (
Inventory, ox_inventory, qb-inventory, tgiann-inventory
Targeting, ox_target, qb-target
Library, ox_lib, (no real alternative)
Database, oxmysql, mysql-async (legacy)
Lua runtime, Lua 5.4, Lua 5.3
Sync, OneSync Infinity, OneSync Legacy
NUI framework, React 19 + Vite, Svelte 5, vanilla HTML/JS
If you're not sure what stack your server uses, check
How To Test Your Code
Every lesson assumes you have a dev server running. The fastest way to set one up:
There's no hot reload for Lua. **Restart on every change.
…
Beginner-to-shipping FiveM coding course. Built by a working FiveM dev. No fluff, no padding, every Lua line explained.📖 Read it as a website → sammethot.github.io/learn-fivem
Searchable, themed, with a navigation tree and copy-paste code buttons. Same content, nicer to read.
If you've ever opened a FiveM resource on GitHub and felt lost - this fixes that.
Who This Is For
You'll get the most out of this if you:
- Have done a little code before (any language: JS, Python, C#, doesn't matter). You know what a variable, a function, and a loop are.
- Want to write server-side scripts, UI menus, jobs, or full game systems for a FiveM server.
- Don't know Lua. You learn it here.
- Don't know FiveM internals. Same.
if, for, and functions.What You'll Be Able To Build
By the end:
- Custom commands and chat events
- Job systems with permissions
- Shops with money + inventory + database logging
- HTML/React UIs that talk to the game
- Resources that don't tank your server's framerate
- Code that doesn't get exploited the day you ship it
Thing, Why
PC with FiveM installed, You can't test without playing
Code editor (VS Code recommended), Syntax highlighting, file explorer, terminal
Local FiveM dev server (txAdmin is the easiest), You need a server to load your code into
Basic Git (GitHub Desktop if you hate the command line), To version-control your work
A MySQL client (HeidiSQL on Windows, DBeaver cross-platform), To poke at the database
VS Code extensions worth installing day one:
- sumneko.lua - Lua language server (autocomplete, errors)
- overextended.cfxlua-vscode - FiveM native autocomplete
Read in order. Each folder builds on the last. Skipping = confusion later.
01-basics → what FiveM is, Lua, client/server, resources
02-events → how scripts talk to each other
03-natives → the GTA V API
04-database → MySQL with oxmysql
05-frameworks → Qbox / QBCore / ESX basics
06-ox-libraries → ox_lib, ox_target, ox_inventory
07-nui → UI (HTML/CSS/JS, then React)
08-security → don't get exploited
09-performance → don't freeze the server
10-first-projects → build 3 real things end-to-endEach lesson ends with **
Next: ** so you always know where to go.If you feel lost, jump to [
INDEX.md](https://github.com/SamMethot/learn-fivem/blob/main/INDEX.md) for the full map and shortcut paths.How Each Lesson Is Structured
Every lesson follows the same shape so you know what to expect:
- Plain-English summary at the top - what is this, why do you care
- Code examples with every line annotated - no "magic" lines
- Common mistakes - the bugs that bite beginners
- Optimization & security callouts where they matter
- TL;DR - the takeaway in 5 bullets
- Sources - links to the official docs so you can dig deeper
-- declare a local variable. "local" = scoped to this file/block, NOT shared globally
local playerName = 'Sam'
-- print it to the server console (F8 in-game, or your terminal)
print(playerName)Every non-trivial line gets a comment. You shouldn't have to guess what any line does.
Core Rules (Memorize These)
These come back in every lesson. Burn them in now:
- Client = hostile. Server = trusted. Always validate on the server. Never trust what the client sends.
- No secrets in client code. Players can read your client
.luafiles. Webhooks, API keys, prices - server only. - **
local src = sourceis the first line of every server net event.** Why. - Always parameterize SQL.
?placeholders, never string concatenation. Why. - Read a similar resource before writing a new one. Patterns in the wild beat patterns from your head.
- Small commits. One feature at a time. Easier to revert when something breaks.
Most examples target the modern FiveM roleplay stack. If your server differs, adapt - the core concepts stay identical.
Thing, What we use, Common alternative
Framework, [Qbox (
qbx_core)](https://docs.qbox.re/), QBCore, ESXInventory, ox_inventory, qb-inventory, tgiann-inventory
Targeting, ox_target, qb-target
Library, ox_lib, (no real alternative)
Database, oxmysql, mysql-async (legacy)
Lua runtime, Lua 5.4, Lua 5.3
Sync, OneSync Infinity, OneSync Legacy
NUI framework, React 19 + Vite, Svelte 5, vanilla HTML/JS
If you're not sure what stack your server uses, check
server.cfg for the ensure lines.How To Test Your Code
Every lesson assumes you have a dev server running. The fastest way to set one up:
- Install txAdmin (it's the recommended FiveM server manager)
- Use the "QBox + ox_lib + ox_inventory" recipe (built-in)
- Start your server, connect from FiveM, and you're in
**edit your code**
**save the file**
**in-game F8 console:**
restart my_resource
**test the change in-game**There's no hot reload for Lua. **Restart on every change.
…