Use AI to help write a small FiveM resource, then verify every dependency and behavior before expanding it. Begin with a standalone command so you can distinguish Lua, resource loading and console errors from framework or database problems.
The configuration and code examples here target FiveM for GTA V Legacy. Enhanced has different runtime and compatibility rules; check Cfx.re’s Legacy-to-Enhanced changes before applying them to an Enhanced server.
Give the assistant a bounded task
Tell the assistant your FXServer build, runtime language and exact framework/dependencies. Share only files you are permitted to share, with secrets and player data removed. Ask it to identify assumptions and link each unfamiliar API to official documentation.
Example request: “Create a standalone Lua resource with a client command named hello_tutorial. It should print one message in F8, require no framework or network events, and include every file plus installation and verification steps.”
Build the minimal resource
Create resources/[local]/hello_tutorial/. Save these two files there. This is a complete console demonstration, not a vehicle shop or production economy system.
fxmanifest.lua:
fx_version 'cerulean'
game 'gta5'
client_script 'client.lua'
client.lua:
RegisterCommand('hello_tutorial', function()
print('Hello from the tutorial resource.')
end, false)
Start and verify
Add ensure hello_tutorial to the active server.cfg. For a running development server, run refresh followed by ensure hello_tutorial in the server console. Connect a test client, open F8 and run hello_tutorial. Expect the exact greeting and no Lua error.
If the command is unknown, check the resource folder, manifest and startup log. If Lua reports a file/line error, compare the saved file with the example. Remove the ensure line and stop the resource when you finish the exercise.
Review the next change before adding it
Ask for one behavior at a time and inspect the diff. For a UI, require complete open/close handling and released focus. For spawned entities, require model validation, bounded loading and cleanup. For database work, require an exact schema and parameterized queries.
Server-side rewards need more than a valid item name: the server must verify permission, task completion, amounts and repeated requests. Do not accept a generated network event that grants money because the client asks for it.
Use errors as evidence
Provide the first relevant error, the execution side, affected resource/version and a short reproduction. Ask the assistant to explain the cause before changing code. Confirm suggested natives and framework methods against official documentation or the installed source; an AI claim that code is secure or tested is not evidence.
Test beyond the happy path
Keep a test record showing the starting state, action and observed result. As the resource grows, include missing dependencies, unauthorized players, invalid arguments, disconnects and restart persistence. Syntax checks and mock tests help, but a development-server test is still required before live deployment.
Reference documentation
Cfx.re — creating your first script · Cfx.re — resource manifest · Cfx.re — server security