PiTyUs.Hire me

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.

Updated 11 min readBy PiTyUs · FiveM developer

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

ConsoleHow to openShows
F8 (client)Press F8 in gameClient and shared script errors, client prints, connection messages
Server consoleThe window/terminal running the serverServer script errors, server prints, resource start messages
txAdmin Live ConsoletxAdmin web panel → Live ConsoleThe same output as the server console, in the browser

Reading an error line

A typical errortext
SCRIPT ERROR: @my_job/client/main.lua:23: attempt to index a nil value (local 'data')
PartMeaning
@my_jobThe resource
client/main.luaThe file inside it
:23The line number
attempt to index a nil valueWhat 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

MessageUsually means
attempt to index a nil valueA table or object you expected is nil
attempt to call a nil valueThe function does not exist (typo, wrong side, missing export)
attempt to compare number with nilA value you compare is missing
unexpected symbol nearA syntax error — missing end, comma or quote
No such exportThe export name or resource is wrong, or it is not started
Couldn't find resourceThe ensure name does not match a folder
Failed to verify protected resourceAn escrowed resource not owned by this server’s key

01A simple debugging routine

  1. Reproduce the problem and note the first error in the right console.
  2. Open the file at the line it names.
  3. Add print() lines just before it showing the values involved — print(json.encode(data)) shows whole tables.
  4. Restart only that resource (ensure name) and reproduce again.
  5. Fix the cause (a missing check, a wrong name), then remove the prints.
Guarding against nillua
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

CommandWhereDoes
resmon 1F8Resource monitor — see resmon
quitF8Close FiveM
disconnectF8Leave the server
ensure nameServerRestart one resource
refreshServerRescan resources after adding folders
stop name / start nameServerStop 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