Getting started
Where FiveM errors appear and how to read them
Find and read FiveM errors: the F8 client console, the server console and txAdmin live console, how to read a SCRIPT ERROR line with file and line number, common messages, and useful console commands for debugging.
Overview
Every FiveM bug leaves a trace — the trick is knowing where to look. Client-side errors appear in one place, server-side errors in another, and many beginners stare at the wrong one. Once you know both consoles and how to read an error line, most problems are solved in minutes instead of evenings.
The two consoles
| Console | How to open | Shows |
|---|---|---|
| F8 (client) | Press F8 in game | Client and shared script errors, client prints, connection messages |
| Server console | The window/terminal running the server | Server script errors, server prints, resource start messages |
| txAdmin Live Console | txAdmin web panel → Live Console | The same output as the server console, in the browser |
Reading an error line
SCRIPT ERROR: @my_job/client/main.lua:23: attempt to index a nil value (local 'data')| Part | Meaning |
|---|---|
@my_job | The resource |
client/main.lua | The file inside it |
:23 | The line number |
attempt to index a nil value | What went wrong: you used . or [] on something that is nil |
(local 'data') | Which variable was nil |
Open the file at that line. In this example data was nil — usually because a callback, a database query or an export returned nothing. The most common messages and their fixes are in common Lua errors.
Messages you will meet
| Message | Usually means |
|---|---|
attempt to index a nil value | A table or object you expected is nil |
attempt to call a nil value | The function does not exist (typo, wrong side, missing export) |
attempt to compare number with nil | A value you compare is missing |
unexpected symbol near | A syntax error — missing end, comma or quote |
No such export | The export name or resource is wrong, or it is not started |
Couldn't find resource | The ensure name does not match a folder |
Failed to verify protected resource | An escrowed resource not owned by this server’s key |
01A simple debugging routine
- Reproduce the problem and note the first error in the right console.
- Open the file at the line it names.
- Add
print()lines just before it showing the values involved —print(json.encode(data))shows whole tables. - Restart only that resource (
ensure name) and reproduce again. - Fix the cause (a missing check, a wrong name), then remove the prints.
local data = exports.my_bank:getAccount(src)
if not data then
print(('no account for %s'):format(src))
return
end
print(data.balance)Console commands that help
| Command | Where | Does |
|---|---|---|
resmon 1 | F8 | Resource monitor — see resmon |
quit | F8 | Close FiveM |
disconnect | F8 | Leave the server |
ensure name | Server | Restart one resource |
refresh | Server | Rescan resources after adding folders |
stop name / start name | Server | Stop or start a resource |
Frequently asked questions
How do I see FiveM script errors?
Client errors appear in the F8 console in game; server errors appear in the server console or txAdmin’s Live Console.
What does 'attempt to index a nil value' mean?
You used . or [] on a variable that is nil. The error names the variable and the line; check why it has no value there.
Which error should I fix first?
The first one. Later errors are often caused by it.
Why is there no error but my script does nothing?
The resource may not be started, or the error is in the other console. Check both, and add print() calls to confirm the code runs.
Need this built, not just explained?
Ten years of FiveM work, from Lua to NUI
Custom resources, React NUI, ESX / QBCore / Qbox integration, OneSync performance audits and security reviews — plus the websites and SEO around your server brand.
Related guides
- EngineeringThe FiveM Lua errors you will see most, and their fixes“Attempt to index a nil value” means you used . or [] on something that is nil — the object you expected was never set. “Attempt to call a nil value” means the function does not exist. Arithmetic, concatenate and compare errors mean a value you used is nil. Syntax errors (“'end' expected”, “unexpected symbol”) point at a missing keyword or character near the named line.
- Engineeringresmon: finding the resource that is eating your framesPress F8 and type resmon 1 (or resmon true) to open the client resource monitor. The CPU msec column is how many milliseconds per frame each resource uses; idle resources should sit near 0.00–0.02 ms, and anything consistently above about 0.5 ms deserves a look. Sort by CPU, reproduce the situation where it lags, and inspect the worst resource’s loops.
- Getting startedWrite your first FiveM script, step by stepCreate a folder resources/my_first, add an fxmanifest.lua with fx_version 'cerulean', game 'gta5', a client_script and a server_script, then write a client command that loads a model with RequestModel, waits for HasModelLoaded, spawns it with CreateVehicle and seats the player with SetPedIntoVehicle. Add ensure my_first to server.cfg, restart, and type /car adder in game.
- Getting startedWhat a FiveM resource is, and how the server loads itA resource is a folder inside resources/ containing an fxmanifest.lua. The manifest declares the format (fx_version 'cerulean', game 'gta5'), which scripts run on the client, the server or both, which extra files clients download, and what the resource depends on. The server starts it when server.cfg says ensure foldername.