Skip to main content
TRACK A·RESOURCES AND DATABASE·Verified June 2026 · Lua 5.4 · ox_lib 3.x
Learning with an AI assistant?
Copies this lesson plus 2026 ground rules (no lua54 'yes', Cfx.re Portal, correct callback signatures) as a ready-to-paste mentor prompt.

Reading and editing config.lua

Ninety percent of the time you spend with a downloaded script is not writing code. It is opening one file, config.lua, changing a few values, and restarting. This lesson shows you what that file actually is, how a script reads it, and where the landmines are. By the end you will read any config.lua with confidence and know the difference between a safe edit and one that takes the resource offline.

You'll do
Read a real config.lua, understand the keys most scripts expose, and make a clean before/after edit on an installed script that you prove by restarting it and checking in game.
Time
~18 minutes
You need
A local FiveM practice setup you can restart, one installed script with a config.lua, a text editor, and the txAdmin Live Console open.
You'll learn
The Config = {} table pattern, the keys most scripts expose, why editing config is safe but editing core logic is risky, and exactly how one missing comma breaks a whole resource
BEFORE YOU START

What a config file is

A config.lua is just a Lua file that builds one big table and leaves it where the rest of the script can find it. There is no magic. The whole pattern is this:

code
Config = {}
Config.Debug = true
Config.MaxPlayers = 32

Config = {} creates an empty table, a container that holds named values. Each line after it drops one more value in under a name. Config.Debug is the name Debug inside the Config table, and you read it back the same way you set it. That is the entire idea. A real script just has more lines.

When a script author wants you to change behavior, they pull those changeable values out of the code and into this one file. You edit the file, you do not edit the code. That separation is the point of a config: the risky logic stays sealed, and the safe knobs sit in one place with your name on them.

Keep reading the full lesson

Sign in to start, then unlock every step of this lesson and the full FiveM School with a membership.

Still ahead in this lesson
  • Build it
  • The keys you will meet everywhere
  • Safe edits versus risky edits
  • A real before/after edit
  • How a bad edit breaks the resource
  • If something went wrong
  • What you can do now
  • Try it yourself

The remainder of Reading and editing a script's config.lua is available to FiveM School members.