A FiveM script is called a resource: a folder with an fxmanifest.lua and script files. Here you build the resource hello. When a player types /hello, they get a notification, the script asks the server for an answer and that answer appears in the chat. The code follows the FiveM documentation (December 2026).
Need a server? Our FiveM server hosting starts at €5 a month, with txAdmin ready to go. You can also try one free for 24 hours.
Before you start
- A FiveM server you can join, with the standard chat resource (every txAdmin recipe has it).
- A text editor such as Visual Studio Code. Not Word: it adds invisible formatting to your file.
- Access to txAdmin, for the Live Console.
The three files
On your computer, create a folder hello with three files.
fxmanifest.lua tells FiveM what is in the resource:
fx_version 'cerulean'
game 'gta5'
client_script 'client.lua'
server_script 'server.lua'
cerulean is the current fx_version, and gta5 means FiveM. A client_script runs on every player's PC, a server_script on your server. Since June 2025, all Lua scripts run on Lua 5.4, so you no longer need the old line lua54 'yes'.
client.lua:
RegisterCommand('hello', function()
-- a notification at the bottom left of the screen
BeginTextCommandThefeedPost('STRING')
AddTextComponentSubstringPlayerName('Hello! Your first script works.')
EndTextCommandThefeedPostTicker(false, false)
TriggerServerEvent('hello:ask')
end, false)
RegisterNetEvent('hello:answer', function(text)
TriggerEvent('chat:addMessage', { args = { 'Server', text } })
end)
server.lua:
RegisterNetEvent('hello:ask', function()
local player = source
local name = GetPlayerName(player)
print(name .. ' used /hello')
TriggerClientEvent('hello:answer', player, 'Hi ' .. name .. ', the server heard you.')
end)
How it works:
RegisterCommandcreates the command. Players type it in the chat (key T) as/hello.TriggerServerEventsends an event to the server.RegisterNetEventcatches an event from the other side and runs the function.- On the server,
sourceis the ID of the player who sent the event. Store it in a variable straight away: after aWait, it is no longer correct. TriggerClientEventsends an event to one player. With-1instead ofplayer, it goes to everyone.chat:addMessageneeds the standard chat resource, which txAdmin's recipes start withensure chat.
Never trust what a client sends: cheaters can fire server events themselves, with their own values. So check on the server whether a player may do something. See Secure Your Events.
Uploading and starting
- In the game panel, open Files and go to the resources folder.
- Click Upload, choose Upload Folders and select your
hellofolder. The manifest must be atresources/hello/fxmanifest.lua, not in an extra subfolder. - Go to server.cfg editor, type
hellounder Resources, click Add and then Save. It now starts whenever your server starts. This screen also shows your license key, so don't screenshot it. - Start it without a restart: click Tx Admin at the top of your server page, open Live Console and type
refresh(FiveM then sees new folders), thenensure hello.
Join your server and type /hello. More about resources: Install scripts (resources).
Changing it without a restart
In Files, click a file, change it and click Save Content. Then type ensure hello in the Live Console: only this resource restarts, your server keeps running. ensure starts a resource, or restarts it if it is already running; restart only works on a running resource. Changed fxmanifest.lua? Type refresh first. Or click Restart under Resources in txAdmin.
Reading errors
Server errors appear in the game panel's Console and in the Live Console, errors in client.lua in your own F8 console in the game.
Couldn't find resource hello.: the folder name doesn't match, or you forgotrefresh.hello does not have a resource manifest (fxmanifest.lua): the manifest is missing or one folder too deep.Error parsing script @hello/server.lua: a typo, such as a missing bracket orend. The message includes the line number, for exampleserver.lua:6.SCRIPT ERROR: @hello/server.lua:5: an error while running, on line 5, followed by the cause.
More messages and fixes: Fix common FiveM server errors.

