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.

Your first asset: a command in the game

You printed a line to the server console already. Now build your first real asset, a resource you join the game and trigger yourself. You will type /bananas in-game and watch Bananas are cool appear in the F8 console on your own screen. Same RegisterCommand you already met, but this time the code runs on the client, so the proof shows up in a different place. That difference is the whole point of this lesson.

You'll build
Your first real asset: a /bananas command that prints "Bananas are cool" to the F8 console while you are in the game.
Time
~12 minutes
You need
A local FiveM server you can join and restart, the FiveM client installed, and a text editor (VS Code is free).
You'll learn
What an asset is, how a client_script differs from a server_script, and why a client command prints to F8 in-game and not the server console
BEFORE YOU START

Build it

Make the resource folder

The server has one folder for this asset.

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

code
resources/qu_bananas

Create the files

Every file named in the manifest exists.

Create this exact layout:

code
resources/qu_bananas/
fxmanifest.lua
client.lua

Write fxmanifest.lua

FiveM knows which file to load, and on which side.

Open fxmanifest.lua and paste this:

code
fx_version 'cerulean'
game 'gta5'

client_script 'client.lua'

The key word is client_script. It tells FiveM to send client.lua to each player's game and run it there, not on the server. (There is no lua54 'yes' line: as of June 2025 Lua 5.4 is the only runtime, so that directive is a deprecated no-op you leave out.)

Write the command

The asset is now runnable code.

Open client.lua and paste this:

code
RegisterCommand('bananas', function()
print('[qu_bananas] Bananas are cool')
end, false)

Start it, join, and run it

The line prints in your own F8 console.

Open server.cfg and add this line:

code
ensure qu_bananas

Save, then in the txAdmin Live Console start the asset:

code
refresh
ensure qu_bananas

refresh makes the server notice the new folder; ensure starts it. Now join your own server (in the FiveM client press F8 and type connect 127.0.0.1:30120, or use Direct Connect to the same address). Once you are in the world, press F8 to open the in-game console and type:

code
bananas

That line appears in F8 on your screen, not in the server console. You can also type /bananas in the in-game chat box (press T) and it runs the same way.

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 Your first FiveM script: an in-game command is available to FiveM School members.