{"id":162266,"date":"2024-10-11T19:42:29","date_gmt":"2024-10-11T17:42:29","guid":{"rendered":"https:\/\/hifivem.com\/?p=162266"},"modified":"2026-06-22T20:39:21","modified_gmt":"2026-06-22T18:39:21","slug":"configurando-fxmanifest-lua-fivem","status":"publish","type":"post","link":"https:\/\/fivemx.com\/pt\/setting-up-fxmanifest-lua-fivem\/","title":{"rendered":"Configurando fxmanifest.lua (FiveM)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Setting up a resource manifest (fxmanifest.lua) is essential for every FiveM resource, including maps, scripts, and other content types. The <code>fxmanifest.lua<\/code> file serves as the configuration file for your resource, specifying metadata, files to be loaded, and scripts that should run on the client or server side. This guide will help you transition from the older <code>__resource.lua<\/code> setup to the more modern and flexible <code>fxmanifest.lua<\/code> system, which is now the standard for FiveM resources.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#what-is-fxmanifest-lua\">What is fxmanifest.lua?<\/a><\/li><li><a href=\"#basic-structure-of-fxmanifest-lua\">Basic Structure of fxmanifest.lua<\/a><\/li><li><a href=\"#step-by-step-guide-to-setting-up-fxmanifest-lua\">Step-by-Step Guide to Setting Up fxmanifest.lua<\/a><\/li><li><a href=\"#special-cases-and-additional-options\">Special Cases and Additional Options<\/a><\/li><li><a href=\"#complete-example-of-fxmanifest-lua\">Complete Example of fxmanifest.lua<\/a><\/li><li><a href=\"#troubleshooting-common-issues\">Troubleshooting Common Issues<\/a><\/li><li><a href=\"#faq\">FAQ<\/a><\/li><li><a href=\"#conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-fxmanifest-lua\">What is <code>fxmanifest.lua<\/code>?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>fxmanifest.lua<\/code> is the configuration file for FiveM resources. It provides information about the resource, specifies which scripts to load, and defines various <a href=\"https:\/\/fivemx.com\/best-fivem-settings\/\" data-wpil-monitor-id=\"1224\">settings<\/a> required for the resource to function correctly in a FiveM server. The manifest replaces the older <code>__resource.lua<\/code> file with a more structured approach, offering better organization and flexibility.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"why-use-fxmanifest-lua\">Why Use <code>fxmanifest.lua<\/code>?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>fxmanifest.lua<\/code> system offers several advantages over <code>__resource.lua<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Better Structure:<\/strong> <code>fxmanifest.lua<\/code> is more organized and allows you to use different metadata fields.<\/li>\n\n\n\n<li><strong>Compatibility:<\/strong> It supports new game builds and includes backward compatibility options.<\/li>\n\n\n\n<li><strong>Flexibility:<\/strong> You can define additional data and custom metadata fields.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"basic-structure-of-fxmanifest-lua\">Basic Structure of <code>fxmanifest.lua<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before diving into the setup, let&#8217;s understand the basic structure of an <code>fxmanifest.lua<\/code> file. Below is a typical example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>-- Resource Metadata<br>fx_version 'cerulean'<br>games { 'gta5' }<br><br>author 'Your Name &lt;your.email@example.com&gt;' -- optional<br>description 'A brief description of your resource' -- optional<br>version '1.0.0' -- optional<br><br>-- What to run<br>client_scripts {<br>    'client.lua'<br>}<br>server_scripts {<br>    'server.lua'<br>}<br><br>-- Additional data<br>files {<br>    'data\/file1.dat',<br>    'data\/file2.dat'<br>}<br>data_file 'DLC_ITYP_REQUEST' 'stream\/resource_name.ytyp'<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"breakdown-of-the-sections\">Breakdown of the Sections<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Resource Metadata:<\/strong> This section defines the basic information about your resource, such as the FX version and supported games.<\/li>\n\n\n\n<li><strong>Scripts:<\/strong> Specifies which scripts should run on the client or server.<\/li>\n\n\n\n<li><strong>Additional Data:<\/strong> Optional section for specifying additional files or data files.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s explore each component in detail.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-by-step-guide-to-setting-up-fxmanifest-lua\">Step-by-Step Guide to Setting Up <code>fxmanifest.lua<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Follow these steps to create an <code>fxmanifest.lua<\/code> file for your FiveM resource:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-1-define-the-fx-version\">Step 1: Define the FX Version<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The first line of your <code>fxmanifest.lua<\/code> should define the FX version. This is required and specifies which version of the FiveM framework your resource is targeting. Currently, the most common versions are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>bodacious<\/strong><\/li>\n\n\n\n<li><strong>cerulean<\/strong><\/li>\n\n\n\n<li><strong>adamant<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following line to define your FX version:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>fx_version 'cerulean'<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-2-specify-the-supported-games\">Step 2: Specify the Supported Games<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>games<\/code> section specifies which games your resource supports. Typically, this will be:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>gta5<\/strong> for Grand Theft Auto V<\/li>\n\n\n\n<li><strong>rdr3<\/strong> for Red Dead Redemption 2<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You can specify multiple games if needed:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>games { 'gta5' }<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-3-add-resource-metadata-optional\">Step 3: Add Resource Metadata (Optional)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Although optional, adding metadata like the author, description, and version is a good practice as it helps other developers understand what your resource is about. Here\u2019s how you can add metadata:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>author 'Your Name &lt;your.email@example.com&gt;'<br>description 'A brief description of your resource'<br>version '1.0.0'<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-4-set-up-the-scripts\">Step 4: Set Up the Scripts<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Client Scripts<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Define the scripts that should run on the client&#8217;s side. Use <code>client_scripts<\/code> to list these:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>client_scripts {<br>    'client.lua',<br>    'client_additional.lua' -- Add more scripts if necessary<br>}<br><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Server Scripts<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Define the scripts that should run on the server side. Use <code>server_scripts<\/code> to list these:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>server_scripts {<br>    'server.lua',<br>    'server_helper.lua' -- Additional server-side scripts<br>}<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-5-add-files-to-the-resource\">Step 5: Add Files to the Resource<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your resource includes additional files such as images, data files, or audio files, specify them using the <code>files<\/code> section:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>files {<br>    'html\/ui.html',<br>    'html\/style.css',<br>    'html\/script.js'<br>}<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-6-use-data-files\">Step 6: Use Data Files<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Certain resources require data files for loading map assets, animations, or other custom data. Use the <code>data_file<\/code> directive to specify these:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>data_file 'DLC_ITYP_REQUEST' 'stream\/resource_name.ytyp'<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-7-specify-additional-metadata-optional\">Step 7: Specify Additional Metadata (Optional)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can add custom metadata fields to store extra information about your resource. These fields can be named arbitrarily, and you can add as many as you like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>my_custom_data 'some_value'<br>another_custom_field 'another_value'<br><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"special-cases-and-additional-options\">Special Cases and Additional Options<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"setting-up-maps-in-fxmanifest-lua\">Setting Up Maps in <code>fxmanifest.lua<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For maps, it&#8217;s essential to specify that the resource is indeed a map. Use the <code>this_is_a_map<\/code> directive:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>this_is_a_map 'yes'<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"using-multiple-game-versions\">Using Multiple Game Versions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your resource needs to support multiple games (e.g., GTA V and Red Dead Redemption 2), specify them in the <code>games<\/code> section:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>games { 'gta5', 'rdr3' }<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"setting-dependencies\">Setting Dependencies<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your resource depends on other resources, you can specify these dependencies using the <code>dependencies<\/code> field:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dependencies {<br>    'essentialmode',<br>    'another_required_resource'<br>}<br><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"complete-example-of-fxmanifest-lua\">Complete Example of <code>fxmanifest.lua<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a complete example of an <code>fxmanifest.lua<\/code> file that includes all the aspects we discussed:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>-- Resource Metadata<br>fx_version 'cerulean'<br>games { 'gta5' }<br><br>author 'Your Name &lt;your.email@example.com&gt;'<br>description 'Example resource for a custom script'<br>version '1.0.0'<br><br>-- Resource Settings<br>this_is_a_map 'yes'<br><br>-- Client and Server Scripts<br>client_scripts {<br>    'client\/main.lua',<br>    'client\/helper.lua'<br>}<br>server_scripts {<br>    'server\/main.lua',<br>    'server\/database.lua'<br>}<br><br>-- UI Assets and Additional Files<br>files {<br>    'html\/ui.html',<br>    'html\/style.css',<br>    'html\/script.js',<br>    'audio\/soundtrack.mp3'<br>}<br><br>-- Data Files for Custom Map Assets<br>data_file 'DLC_ITYP_REQUEST' 'stream\/my_custom_map.ytyp'<br><br>-- Custom Metadata Fields<br>custom_info 'Extra info about the resource'<br>random_setting 'random_value'<br><br>-- Dependency Resources<br>dependencies {<br>    'essentialmode',<br>    'mysql-async'<br>}<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<figure class=\"wp-block-image size-medium\"><img decoding=\"async\" width=\"300\" height=\"127\" src=\"https:\/\/fivemx.com\/wp-content\/uploads\/2024\/10\/troubleshooting-300x127.jpg\" alt=\"FiveM\" class=\"wp-image-162268\" srcset=\"https:\/\/fivemx.com\/wp-content\/uploads\/2024\/10\/troubleshooting-300x127.jpg 300w, https:\/\/fivemx.com\/wp-content\/uploads\/2024\/10\/troubleshooting-18x8.jpg 18w, https:\/\/fivemx.com\/wp-content\/uploads\/2024\/10\/troubleshooting-110x46.jpg 110w, https:\/\/fivemx.com\/wp-content\/uploads\/2024\/10\/troubleshooting-60x25.jpg 60w, https:\/\/fivemx.com\/wp-content\/uploads\/2024\/10\/troubleshooting.jpg 724w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"troubleshooting-common-issues\">Troubleshooting Common Issues<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"issue-1-resource-not-loading\">Issue 1: Resource Not Loading<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Check the FX Version:<\/strong> Make sure the <code>fx_version<\/code> is specified correctly and matches a valid version.<\/li>\n\n\n\n<li><strong>Ensure Proper File Paths:<\/strong> Double-check that all paths in the <code>client_scripts<\/code>, <code>server_scripts<\/code>, and <code>files<\/code> sections are accurate.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"issue-2-custom-data-not-working\">Issue 2: Custom Data Not Working<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ensure Correct Syntax:<\/strong> Verify that custom metadata fields and data files are set up using the correct syntax. For example, make sure you are using curly braces <code>{}<\/code> where necessary.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"issue-3-map-not-loading\">Issue 3: Map Not Loading<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Set <code>this_is_a_map<\/code> Properly:<\/strong> Make sure you have included <code>this_is_a_map 'yes'<\/code> in your <code>fxmanifest.lua<\/code>.<\/li>\n\n\n\n<li><strong>Use Correct Data Files:<\/strong> If you are loading custom map assets, ensure that the <code>data_file<\/code> directives are set up accurately.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">FAQ<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Q: What must fxmanifest.lua include?<br>A: fx_version, game, your client\/server\/shared scripts, and files you stream.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: What\u2019s client vs server vs shared?<br>A: Client runs on players, server runs on the host, shared loads on both.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: How do I declare dependencies?<br>A: Use dependency &#8216;name&#8217; or dependencies {&#8216;a&#8217;,&#8217;b&#8217;} and ensure order in server.cfg.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: How do I stream assets?<br>A: Put assets in \/stream and list files as required by the resource type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: Why add lua54 &#8216;yes&#8217;?<br>A: Enables Lua 5.4 features and performance improvements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: Common manifest errors?<br>A: Wrong paths\/names, missing commas, invalid fx_version, or incorrect folder name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: How to export\/import functions?<br>A: Use exports\/server_exports in the manifest and call via exports[&#8216;resourcename&#8217;]:function().<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: What about maps\/MLOs?<br>A: Use this_is_a_map &#8216;yes&#8217; and declare data_file entries for YTYPs if needed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Setting up <code>fxmanifest.lua<\/code> is a straightforward yet crucial step in creating and running resources for a FiveM server. By following the structure and recommendations outlined in this guide, you can ensure that your resources are well-organized, flexible, and compatible with the latest FiveM updates. Make sure to test your setup after making changes and double-check for any errors to keep everything running smoothly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the tips and examples provided, you should now be equipped to create or convert an <code>fxmanifest.lua<\/code> file for any FiveM resource with ease.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up a resource manifest (fxmanifest.lua) is essential for every FiveM resource, including maps, scripts, and other content types. The fxmanifest.lua file serves as the configuration file for your resource, specifying metadata, files to be loaded, and scripts that should run on the client or server side. This guide will help you transition from the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":162267,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2340,1899],"tags":[],"class_list":["post-162266","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lua-scripting","category-tutorials"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/posts\/162266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/comments?post=162266"}],"version-history":[{"count":1,"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/posts\/162266\/revisions"}],"predecessor-version":[{"id":206989,"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/posts\/162266\/revisions\/206989"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/media\/162267"}],"wp:attachment":[{"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/media?parent=162266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/categories?post=162266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemx.com\/pt\/wp-json\/wp\/v2\/tags?post=162266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}