FiveM Docs
Core Resources

esx_loadingscreen

esx_loadingscreen for ESX Legacy explained. How the loading screen works, how to change the logo, tips and texts, and how shutdown with multicharacter works.

esx_loadingscreen is the loading screen players see while they connect to an ESX Legacy server. It shows a logo, a progress bar driven by the game's real load progress and rotating tips. It has no Lua config; you customize it by editing the files in web/.

Overview

Resourceesx_loadingscreen
SideClient (loadscreen NUI)
DependenciesNone
ConfigNone, edit web/script.js, web/style.css, web/logo.png
RequiredNo, any loading screen resource works

The manifest declares loadscreen "web/index.html" and loadscreen_manual_shutdown "yes". Manual shutdown means the game does not close the loading screen on its own; a script has to call ShutdownLoadingScreenNui().

How it works

Progress

FiveM sends loadProgress messages with a loadFraction between 0 and 1 to the page. The bar animates to that value and switches the status text through "Connecting", "Handshaking", "Downloading resources", "Loading scripts", "Spawning player" and "Finalizing".

Completion

When loadFraction reaches 1, the page posts the NUI callback loadingComplete. The client script waits 2500 ms (SHUTDOWN_DELAY) and calls ShutdownLoadingScreenNui().

Spawn

es_extended (without multicharacter) and esx_multicharacter also call ShutdownLoadingScreen() and ShutdownLoadingScreenNui() when the player spawns or the character selection opens, and fire the client event esx:loadingScreenOff.

Customization

WhatWhere
LogoReplace web/logo.png (keep the file name, it is listed in fxmanifest.lua)
Tipstips array in web/script.js (rotates every 6000 ms)
Loading textsloadingTexts array in web/script.js
Status labelsstatuses array in web/script.js
Colors, layoutweb/style.css
FontPoppins from Google Fonts, linked in web/index.html
web/script.js
const tips = [
    "Read the rules at discord.gg/yourserver",
    "Press F1 to open the help menu",
    "Use /report to contact staff",
]

The default tips mention features such as F1 menus and /report that ESX does not ship. Replace them with tips that are true on your server.

If you add new files (a background video, extra images), add them to the files list in fxmanifest.lua, otherwise the client never downloads them.

Events

EventSideDescription
esx:loadingScreenOffClient (local, fired by es_extended / esx_multicharacter)The loading screen was shut down. Use it to show your HUD.
client/main.lua
AddEventHandler("esx:loadingScreenOff", function()
    -- show your HUD here
end)

Common issues

  • Two loading screens fight each other. Only start one resource with a loadscreen entry.
  • Changes do not show up. Loading screen files are cached by the client. Restart the server and clear the FiveM cache (%localappdata%/FiveM/FiveM.app/data/cache) to test.
  • Black screen after loading. The loading screen closed but the player did not spawn. Check es_extended and esx_multicharacter errors in the F8 console.

Frequently asked questions

Independent documentation

esx-fivem.com is a community project and is not affiliated with the ESX Framework team. Facts on this page were checked against the upstream source. Official resources: docs.esx-framework.org and github.com/esx-framework.
Edit on GitHub

Last updated on

On this page