Skip to main content
TRACK B·YOUR FIRST RESOURCE·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.

Start, restart, stop: your daily dev loop

FiveM development is mostly one small loop: edit, save, ensure, read the console, test. Beginners often think they need more tricks than that. They do not. This lesson makes that loop feel normal, and teaches the four server commands that drive it so you always know which one to reach for.

You'll build
A repeatable workflow: edit -> save -> ensure -> read console -> test.
Time
~15 minutes
You need
The qu_hello resource from Lessons 07 and 08, and a running FiveM server.
You'll learn
The four commands -> reading the server console -> the dev loop -> server.cfg -> common error patterns
BEFORE YOU START

Build it

Make the resource folder

The server has one folder for this lesson.

Inside your server's resources folder, create this folder:

code
resources/qu_dev_loop

Create the files

Every file named in the manifest exists.

Create this exact file layout:

code
resources/qu_dev_loop/
fxmanifest.lua
server.lua

Write fxmanifest.lua

FiveM knows which files to load.

Open fxmanifest.lua and paste this:

code
fx_version 'cerulean'
game 'gta5'

server_script 'server.lua'

Older tutorials add a lua54 'yes' line here. As of June 2025 that setting is deprecated and ignored: Lua 5.4 is now the only Lua runtime, so you leave it out.

Write the lesson code

The topic is now represented by runnable code.

Open server.lua and paste this:

code
print('[qu_dev_loop] resource started')

RegisterCommand('dev_loop', function()
print('[qu_dev_loop] command fired')
end, false)

There are two prints on purpose. The first one is at the top level of the file, so it runs the moment the resource starts. That is what proves your restart actually reloaded the code. The second one lives inside a command handler, so it only runs when you type the command.

Start and test it

The expected proof appears in the server console.

Open server.cfg and add this line:

code
ensure qu_dev_loop

Save the file. Because this folder is brand new, the running server has not scanned it yet, so first tell it to look, in the txAdmin Live Console (the server console):

code
refresh

Then start the resource, also from the server console:

code
ensure qu_dev_loop

Use ensure, not restart, the first time: the resource has not started yet this session, and restart only reloads a resource that is already running, so it would do nothing here. (Once the resource is already up, restart is the command you use after each edit.) You should see the start line print immediately. Now run the command, also from the server console:

code
dev_loop
txAdmin · Live Consoleensure
> ensure qu_dev
Started resource qu_dev

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
  • How it works
  • If something went wrong
  • What you can do now
  • Try it yourself

The remainder of Start, restart, stop: the dev loop is available to FiveM School members.