Skip to content
FIVECRATE

How to Make a FiveM Loading Screen: Music and Progress Bar

Learn how to make a FiveM loading screen: the loadscreen manifest entry, music, a progress bar, handover data, and replacing the ESX, Qbox or QBCore default.

Designer viewing a sunset city loading screen with a thin progress bar and audio waveform
Author: FiveCrate
Published:
Updated:
Read time: 15 min
Applies to
FiveM Legacy and FiveM for GTAV Enhanced (early access); Cfx.re loading screen docs and FiveM client source read on December 2, 2026; cfx-server-data example-loadscreen (September 23, 2026); esx_loadingscreen in esx_core (October 18, 2026); loadscreen v2.2.1 from the Qbox recipe; QBCore qb-loading 1.2.0 (August 24, 2026)
Last verified

Direct Answer

A FiveM loading screen is an HTML page inside a resource. To make one, put an index.html (plus its images, CSS and music) in a resource folder, add loadscreen 'index.html' and a files list naming every file to its fxmanifest.lua, add ensure with the resource name to server.cfg, and restart the server. The page shows while the game loads after a player joins. Only one loading screen is displayed, so stop the one your framework or recipe already runs: esx_loadingscreen on ESX Legacy, loadscreen on Qbox, qb-loading on QBCore. Music, a progress bar and the player’s name all come from documented NUI features covered below.

What a FiveM loading screen is

The Cfx.re documentation calls the loading screen a special NUI frame “called loadingScreen, which is shown during loading of FiveM, instead of the default client-side loading screen or the game loading screen, after joining into a server.” NUI is FiveM’s HTML interface layer, which the docs describe as “Currently using the Chromium Embedded Framework”. In practice the loading screen is a web page, and HTML, CSS and JavaScript work in it as they do in a browser.

A resource declares its page with the loadscreen entry in fxmanifest.lua. The resource manifest reference describes it in one line, “Sets the HTML file specified as the game loading screen”, and the page must also be listed with file or files so that clients download it. The entry also accepts a web address instead of a file, as the docs show with loadscreen 'https://my-server.example.com/loadscreen/'.

The loading screen works the same way on every kind of server: roleplay, racing, PvP, zombie or a freeroam server without a framework. Only the shutdown step, covered further down, depends on which spawn or character resource you run.

Only one loading screen is shown

When a player joins, the FiveM client collects the loadscreen entry of every running resource into a list that starts with the built-in page nui://game/ui/loadscreen/index.html. It then opens a single frame with nui::CreateFrame("loadingScreen", loadingScreens.back()), the last entry in that list. Two running loading screen resources therefore never show side by side; one of them is used and the other is ignored. The client still reads loadscreen_manual_shutdown and loadscreen_cursor from every resource that has a loadscreen entry, so a leftover stock screen can change when your screen closes even though it is not displayed. Keep exactly one running.

How to change the default FiveM loading screen

To change the loading screen, first find the one your server already runs, because the official recipes differ.

Server typeLoading screen in the recipeHow it startsHow it closes
FiveM Basic Server (Legacy)example-loadscreen is downloaded with cfx-server-data but not startedThe recipe’s server.cfg ensures only mapmanager, chat, spawnmanager, basic-gamemode and hardcapspawnmanager calls ShutdownLoadingScreen()
FiveM Basic Server (Enhanced)None: the recipe copies only basic-gamemode, mapmanager, spawnmanager and two mapsNot applicablespawnmanager
ESX Legacyesx_loadingscreen inside the [core] folderensure [core]Its own client script, plus esx_multicharacter
Qboxloadscreen v2.2.1, unzipped to resources/[standalone]/loadscreenensure [standalone]qbx_core calls ShutdownLoadingScreenNui()
QBCoreqb-loadingThe line or category folder in your server.cfg that starts itqb-multicharacter calls ShutdownLoadingScreenNui()
vMenu, StreetKings, other game modesCheck the mode’s own resources for a loadscreen entry

ensure with a bracketed category name such as [core] starts every resource in that folder; the server commands reference says that start, stop and ensure all accept “a category name”. On ESX and Qbox you cannot remove the stock screen by deleting an ensure line. Move esx_loadingscreen or loadscreen out of its category folder or delete it, then add your own.

How to make and install a custom FiveM loading screen

These steps apply to FiveM Legacy and FiveM for GTAV Enhanced, with the Enhanced notes in their own section below.

  1. Start from the official example. Cfx.re’s example-loadscreen resource, part of cfx-server-data (last changed September 23, 2026), is a complete loading screen with four files: index.html, keks.css, bankgothic.ttf and loadscreen.jpg. On a Legacy server built from the FiveM Basic Server recipe it is already in your resources folder. Copy the folder, give it a new name, and replace the files with your own.

  2. Write the manifest. This is the example’s fxmanifest.lua:

    version '1.0.0'
    author 'Cfx.re <root@cfx.re>'
    description 'Example loading screen.'
    repository 'https://github.com/citizenfx/cfx-server-data'
    
    files {
        'index.html',
        'keks.css',
        'bankgothic.ttf',
        'loadscreen.jpg'
    }
    
    loadscreen 'index.html'
    
    fx_version 'bodacious'
    game 'gta5'

    List every file the page loads under files: images, fonts, CSS, JavaScript, music and video. A file that is not listed is not downloaded by clients. Larger resources use patterns instead of single names: Qbox’s loadscreen lists 'html/**' and qb-loading lists 'assets/**'. The manifest reference names cerulean as “The current FXv2 resource version”, so new resources can use fx_version 'cerulean'.

  3. Build the page. Write index.html as a normal web page. Point to images, CSS and audio with paths relative to the resource, as the example does with <link href="keks.css" ...> and background-image: url(loadscreen.jpg).

  4. Add the optional manifest lines you need. Each one goes into the same fxmanifest.lua:

    LineWhat it does (Cfx.re docs)
    loadscreen_cursor 'yes'Shows the NUI cursor. The screen always has mouse and keyboard focus, but “the cursor is not shown by default for legacy reasons”
    loadscreen_manual_shutdown 'yes'“Prevents the loadingscreen NUI from shutting down after loading the game data, where you’d usually see the bridge. Can then be closed with SHUTDOWN_LOADING_SCREEN_NUI.”

    Add the cursor line if your page has buttons, a volume slider or links. Read the shutdown section below before you add the second line.

  5. Start it from server.cfg. Put the folder in your resources directory and add one line with the folder name:

    ensure my-loadscreen

    ensure “Restarts the resource specified in the argument, if it was started. If it wasn’t, starts the resource specified in the argument.” If the server is already running, type refresh in the console first, which “Rescans the resources folder and loads all resource manifests in them”. The script installation guide covers folder levels and start order.

  6. Remove the old one and test. Stop or remove the screen your recipe installed (see the table above), restart the server and join it. The loading screen only appears while a client loads into the server, so every change needs a new join to be seen.

How to add music to a FiveM loading screen

Music needs no game API: an HTML <audio> element plays it. QBCore’s qb-loading does exactly that:

<audio autoplay loop id="audio" src="/assets/audio/noncopyright.mp3"></audio>

Its app.js then sets the starting volume with audio.volume = 0.05; and toggles playback with audio.play() and audio.pause().

Players do not have to click before the sound starts. In the FiveM client source, the client starts its embedded browser with the switch AppendSwitchWithValue("autoplay-policy", "no-user-gesture-required"), so an autoplay attribute works in NUI. Three things decide whether players actually hear the track:

  • The file must be listed in files. qb-loading covers its audio folder with 'assets/**'.
  • A low start volume and a mute control are worth adding. Qbox’s loadscreen starts at loadscreen:initialAudioVolume 10 (out of 100), shows audio controls, mutes on Space and remembers the volume each player sets. Its manifest also sets loadscreen_cursor 'yes', so players can use those controls with the mouse.
  • Video works the same way through a <video> element. qb-loading ships a commented-out <video ... autoplay loop muted> block for freestockvideo.mp4. Qbox’s loadscreen.cfg advises: “If your custom video isn’t working, try to convert it to different codecs & formats (such as webm).”

On a Qbox server you can change the music without touching code: put your track in html/assets/music and keep loadscreen:music on (it is on by default). The resource’s handover.js lists the files in that folder when the resource starts, so restart the resource or the server after adding a track. Its other settings are convars such as loadscreen:background (image, video, embed or a CSS background) and loadscreen:serverMessage. The loadscreen.cfg file in the resource lists them all, but its first line says “this file is an example!”: copy the convars you want to change into server.cfg, as the Qbox recipe does with setr loadscreen:externalShutdown true, or run the file with exec @loadscreen/loadscreen.cfg.

How to add a loading bar: the loadProgress event

The client sends loading events to the page as message events. The docs explain that you handle them “by setting window.onmessage or by using window.addEventListener with ‘message’ as the first argument, and checking the eventName value inside the event’s data field.” This is their progress bar example:

<progress id="loading-bar" value="0" max="1"></progress>

<script type="text/javascript">
window.addEventListener('message', (event) => {
    // ensure that we are handling the loadProgress event
    if (event.data.eventName !== 'loadProgress') return;

    // use the event's data to fill up the loading bar
    document.getElementById('loading-bar').value = event.data.loadFraction;
});
</script>

loadFraction is a number between 0 and 1. In the client source it is sent as 0.0 when the “before map loaded” stage starts and as 1.0 when the session stage ends, with values in between computed from the client’s stored load timings. ESX’s esx_loadingscreen multiplies it by 100 for its percentage and treats loadFraction >= 1 as the end of loading.

The full event list and what each event carries

The docs list the event names. The fields come from the client source (LoadingScreens.cpp):

EventFields in event.dataWhen it fires
loadProgressloadFractionOverall progress, 0 to 1
onLogLinemessageStatus text such as “Entering session”, “Setting up game”, “Initializing session” or “Starting game”
startInitFunctiontypeA loading stage starts, for example INIT_BEFORE_MAP_LOADED or INIT_SESSION
startInitFunctionOrdertype, order, countA group of init functions starts
initFunctionInvokingtype, name, idx, countOne init function starts
initFunctionInvokedtype, nameOne init function finished
endInitFunctiontypeA loading stage ended
startDataFileEntriescountMap data files start loading
onDataFileEntrytype, isNew, nameOne data file entry is loaded
performMapLoadFunctionidxOne map load step runs
endDataFileEntriesnoneMap data files are done

The official example builds its bar from initFunctionInvoking (data.idx / count) and performMapLoadFunction, and prints each onLogLine message. Its September 23, 2026 fix handles “unknown init types such as INIT_CORE”, so a handler should not assume it knows every type value.

Show the player’s name: handover data

A server script can pass data to the page while the player connects. The docs: “Server scripts can specify data pairs to send to the client loading screen using the handover function in the playerConnecting event. This data will be passed to the loading screen in the window.nuiHandoverData property.” Their example has two parts. The server script:

AddEventHandler('playerConnecting', function(_, _, deferrals)
    local source = source

    deferrals.handover({
        name = GetPlayerName(source)
    })
end)

And the page:

<h1 id="namePlaceholder">Welcome, <span></span></h1>

<script type="text/javascript">
window.addEventListener('DOMContentLoaded', () => {
    console.log(`You are connecting to ${window.nuiHandoverData.serverAddress}`);

    // a thing to note is the use of innerText, not innerHTML: names are user input and could contain bad HTML!
    document.querySelector('#namePlaceholder > span').innerText = window.nuiHandoverData.name;
});
</script>

The client also adds serverAddress, “the current IP/port used for the client->server connection”. Keep the docs’ warning in mind: player names are user input, so write them with innerText. Qbox’s loadscreen uses this mechanism for all of its settings: its handover.js reads the loadscreen:* convars on playerConnecting and sends them, with the player name and the server name, through deferrals.handover.

Hide the busy spinner

The busy spinner in the bottom right corner is a server setting, not part of your page. The docs give this server.cfg line:

setr sv_showBusySpinnerOnLoadingScreen false

setr makes it a replicated convar, which the convars documentation describes as “available on the client side to get the value, but you will only be able to change the convar value from the server side.”

When the loading screen closes: manual shutdown

By default, “the loading screen will show until SHUTDOWN_LOADING_SCREEN is called”. On a server without a framework, spawnmanager makes that call (ShutdownLoadingScreen()) when it spawns the player.

With loadscreen_manual_shutdown 'yes' the page stays up until a script calls SHUTDOWN_LOADING_SCREEN_NUI (ShutdownLoadingScreenNui() in Lua). The docs say this lets you “add a custom fade-out effect from the loading screen to an in-game view, or integrate NUI events with early-game spawn selection UI”, and that SEND_LOADING_SCREEN_MESSAGE becomes available at the same time. The older native SET_MANUAL_SHUTDOWN_LOADING_SCREEN_NUI is not supported; the client prints that you should use the manifest entry instead.

Something must make that call, and the frameworks handle it differently:

  • Qbox: qbx_core calls ShutdownLoadingScreen() and ShutdownLoadingScreenNui() when it opens character selection. Its character script does not run when useExternalCharacters is enabled in its client config; the external character resource then has to make the call. The Qbox recipe sets setr loadscreen:externalShutdown true so its loadscreen waits for that.
  • ESX Legacy: esx_loadingscreen uses manual shutdown and closes itself through an NUI callback, loadingComplete, 2500 ms after loading ends (SHUTDOWN_DELAY). esx_multicharacter also calls ShutdownLoadingScreenNui().
  • QBCore: qb-multicharacter calls ShutdownLoadingScreenNui().
  • No framework: nothing calls it. Qbox’s loadscreen handles this case with loadscreen:externalShutdown false, its default: its own client script then calls ShutdownLoadingScreen() and ShutdownLoadingScreenNui() itself.

If you replace a framework’s screen with one that uses manual shutdown, the framework’s character resource closes it. If you run no framework, either leave the line out or add a client script that closes the screen.

Loading screens on FiveM for GTAV Enhanced

Cfx.re’s page “What’s Changed in FiveM for GTAV Enhanced” has no entry for loading screens, the loadscreen manifest entries or the loading screen events. One listed change can affect a loading screen: “All resources now have nui_callback_strict_mode enabled by default.” With strict mode, “only NUI belonging to the resource that registered a callback may invoke it.”

A loading screen that calls a callback registered by its own resource, as esx_loadingscreen does with loadingComplete, is not affected. A page that calls a callback in another resource is blocked on Enhanced with “HTTP 403 with status text The requested NUI callback was forbidden.”, and “nothing is printed to the console”. The docs’ fix is to move the shared logic into an export and register a proxy callback in your own resource, or to add nui_callback_strict_mode 'false' to the manifest. The fresh Enhanced Basic recipe contains no loading screen. The Enhanced server guide covers the other differences.

Troubleshooting

The default GTA loading screen still shows

Your resource is not running or its loadscreen path is wrong. Check the server console for errors when it starts; the Couldn’t start resource guide explains the common ones. Make sure the path in loadscreen matches the file exactly and that the file is also in files. The fxmanifest.lua guide covers the other manifest entries.

The old ESX, Qbox or QBCore loading screen still shows

Two resources declare loadscreen, and the client shows only one of them. Take the stock one out of its category folder or delete it, as described in the table at the top.

FiveM loading screen stuck after loading

The page uses loadscreen_manual_shutdown 'yes' and no script calls ShutdownLoadingScreenNui(). This happens when a framework’s loading screen runs on a server without that framework’s character resource, or when Qbox’s loadscreen:externalShutdown is true without qbx_core. A stock screen that is still running can also cause it: its loadscreen_manual_shutdown line counts even when your page is the one displayed. Set the convar to false, remove the manifest line or the leftover resource, or add a script that makes the call.

No music on the loading screen

Check that the audio file is listed in files and that its path in the page is right. Autoplay is allowed by the client, so check the file and its path first. On Qbox, a player may have muted the track earlier: the resource remembers each player’s volume when loadscreen:rememberVolume is on.

Mouse cursor not showing on the loading screen

Add loadscreen_cursor 'yes' to the manifest. Without it the screen still takes input, but the cursor is hidden.

The progress bar jumps from 0 to 100

loadProgress starts at 0 and ends at 1, and the values in between depend on the client’s load timings. For a bar that moves in smaller steps, use initFunctionInvoking and performMapLoadFunction as the official example does.

Inspecting the page with dev tools

The client console command nui_devtools “Opens the NUI dev tools window from the game process”. Use it to read JavaScript errors and failed requests in your page.

Next Steps

Official documentation and repository references