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.
Build it
Make the resource folder
Inside your server's resources folder, create this folder:
resources/qu_bananas
Create the files
Create this exact layout:
resources/qu_bananas/
fxmanifest.lua
client.lua
Write fxmanifest.lua
Open fxmanifest.lua and paste this:
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
Open client.lua and paste this:
RegisterCommand('bananas', function()
print('[qu_bananas] Bananas are cool')
end, false)
Start it, join, and run it
Open server.cfg and add this line:
ensure qu_bananas
Save, then in the txAdmin Live Console start the asset:
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:
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.
- 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.