__resource.lua to fxmanifest.lua: how to convert an old script

Old FiveM script still uses __resource.lua and shows a deprecated warning? How to convert it to fxmanifest.lua with fx_version, game, lua54, ui_page and files.

You start an old script and the console warns that it still uses __resource.lua, which is deprecated. The script may still run, but it is stuck on the old manifest format and cannot use newer options such as Lua 5.4. This guide converts it to fxmanifest.lua in a few minutes.

What changed

Every resource needs a manifest that tells FiveM which files to load. The old format was __resource.lua. The current format is fxmanifest.lua. The directives you know (client_script, server_script, ui_page, files) are the same. What changes is the header.

An old manifest looks like this:

lua
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'

client_script 'client.lua'
server_script 'server.lua'

ui_page 'html/index.html'
files {
    'html/index.html',
    'html/script.js',
    'html/style.css',
}

The new header

Replace the resource_manifest_version line with two lines:

lua
fx_version 'cerulean'
game 'gta5'

fx_version is required. It selects the manifest behaviour, and cerulean is the version current scripts use. game 'gta5' says the resource is for GTA V. The old UUID in resource_manifest_version is replaced by fx_version: you do not need to translate it to a specific old version name, just delete it.

The full converted file

lua
fx_version 'cerulean'
game 'gta5'

lua54 'yes'

author 'Your name'
description 'What the resource does'
version '1.0.0'

client_scripts {
    'client.lua',
}

server_scripts {
    'server.lua',
}

ui_page 'html/index.html'

files {
    'html/index.html',
    'html/script.js',
    'html/style.css',
}

Notes on each part:

  • client_scripts and server_scripts take a list. The singular client_script 'file.lua' still works for one file.
  • shared_scripts loads on both sides. A framework import like '@ox_lib/init.lua' goes there.
  • ui_page points at the HTML file of the NUI. Every file the page loads (JS, CSS, images, fonts) must be in files, or it is not sent to the player. Wildcards work: 'html/**/*'.
  • files is also where you list data a client needs but does not run, such as meta files.
  • author, description and version are optional and only informational.

Lua 5.4

lua54 'yes' makes the resource run on Lua 5.4. Many current resources require it. Turning it on for an old script is usually safe, but check two things: a script that relies on old Lua 5.3 behaviour may need a small fix, and scripts that use ox_lib need Lua 5.4 enabled. Leave it out if the old script behaves differently with it, and test it.

Maps, data files and streamed assets

If the old manifest has data_file lines for vehicle or weapon meta, keep them. They have the same syntax in fxmanifest.lua:

lua
files {
    'data/vehicles.meta',
    'data/handling.meta',
}

data_file 'HANDLING_FILE' 'data/handling.meta'
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'

Streamed models and textures in a stream folder need no entry at all. For a map-only resource, add this_is_a_map 'yes' as well.

Remove the old file

After converting, delete __resource.lua from the folder. Leaving both files in place is confusing for whoever maintains the server later, and only one of them should describe the resource.

Then restart the resource:

text
refresh
ensure my_script

refresh is needed because the manifest changed. If the manifest has a mistake, the resource will not start: see Couldn't start resource to read the error above that line.

Common mistakes after converting

  • A missing fx_version or game. The manifest is rejected.
  • A comma missing inside { }. Each entry in a list is separated by a comma.
  • Files missing from files. The NUI loads but images or scripts are blank, because the page asked for something that was not sent. Check the F8 console and the NUI devtools for failed requests.
  • A dependency that is not declared. Add dependency 'ox_lib' if the script uses it, so the start order is checked. See Could not find dependency.

Warning: do not set fx_version to a very old name copied from a 2019 tutorial just to match the script's age. Use cerulean and fix anything that breaks.

Checklist

Symptom Fix
Console warns about __resource.lua Create fxmanifest.lua, delete the old file
resource_manifest_version line Replace with fx_version 'cerulean' and game 'gta5'
NUI blank after converting List every NUI file under files and keep ui_page
ox_lib functions missing Add lua54 'yes' and the @ox_lib/init.lua shared script
Resource not found after the change Run refresh, then ensure
Resource does not start Read the lines above Couldn't start resource

Quick answers

Is __resource.lua still supported?

FiveM still reads it for old resources, but it is deprecated and prints a warning. New features such as lua54 only exist in fxmanifest.lua, so convert it.

What fx_version should I use?

cerulean is the common choice today. It is the version most current scripts declare, and it works on a current server artifact.

Do I have to keep resource_manifest_version?

No. fx_version replaces it. Delete the resource_manifest_version line when you convert.

Scripts that skip this problem

Clothing DesignerDesign clothing inside FiveM β€” brush, layers, image import and AI β€” then wear it.View script β†’Drag RopeDrag players with a rope and tie them to vehicles, with a live rope length.View script β†’Item Creator V2Create usable items with animations, props, effects and more β€” without writing code.View script β†’

Keep reading