sv_loadingurl is the single console variable behind every custom Garry's Mod loading screen. It tells the server which web page to display to connecting players. This is the full reference: syntax, URL variables, the JavaScript callbacks GMod injects into your page, the alternative URL formats, and fixes for the failures you'll actually run into.
If you just want a working loading screen without reading a reference, the step-by-step installation guide gets you there in five minutes. Or generate a hosted screen and come back here when you're curious how it works.
What sv_loadingurl does
When a player connects, GMod opens the URL you set in sv_loadingurl inside its embedded Chromium browser (CEF) and displays it full-screen while maps, models and materials download. Any web page works. That's why loading screens run the whole range, from a single static image to full dashboards with live server data and music.
Syntax: the three ways to set it
The standard place is your server configuration file:
sv_loadingurl "https://example.com/loading"You can also pass it on the server command line at launch:
+sv_loadingurl "https://example.com/loading"- server.cfg — recommended: survives restarts, easy to edit through any hosting panel's file manager.
- Command line — useful when your host locks server.cfg but exposes launch parameters.
- autoexec.cfg — also executed at startup; equivalent to server.cfg for this purpose.
URL variables: %s and %m
GMod substitutes two placeholders into the URL for every connecting player:
%s— the player's 64-bit SteamID (e.g. 76561198012345678). Lets the page greet the player by name or fetch their avatar.%m— the current map name (e.g. rp_downtown_v4c_v2). Lets the page show which map is loading.
sv_loadingurl "https://example.com/loading?steamid=%s&map=%m"This is how hosted services personalize screens per player. Lumescreen resolves %s to the player's Steam name and avatar automatically, with no API key on your side.
The JavaScript callbacks GMod injects
The Source engine calls global JavaScript functions on your page as loading progresses. Define them on window and your screen can display real progress instead of a fake spinner:
GameDetails(servername, serverurl, mapname, maxplayers, steamid, gamemode, ...)— called once with the server's details when they're known.SetFilesTotal(total)— total number of files the client must download.SetFilesNeeded(needed)— files still remaining; 0 means downloads are done.DownloadingFile(fileName)— called for each file as it starts downloading.SetStatusChanged(status)— engine status text ('Sending client info…', 'Workshop Complete', …).
let total = 0;
window.SetFilesTotal = function (t) { total = t; };
window.SetFilesNeeded = function (needed) {
if (total > 0) {
const percent = Math.round(((total - needed) / total) * 100);
document.getElementById("bar").style.width = percent + "%";
}
};
window.DownloadingFile = function (name) {
document.getElementById("file").textContent = name;
};Every Lumescreen theme wires these callbacks in automatically. The progress bar, current file display and status text you see in the previews are driven by the real engine events. The details are covered in our progress bar deep-dive.
Alternative formats: asset:// and data URLs
Beyond http/https, sv_loadingurl accepts two lesser-known formats:
asset://garrysmod/html/loading.html— loads an HTML file shipped inside the game's content. Useful for fully offline screens, but you can't update it without shipping files.data:text/html,<encoded page>— inlines the entire page into the cvar. Works for tiny screens; unmanageable for anything real.
In practice the https version is the most practical. You can update the screen without touching the server, and players always get the latest version. The other two are worth knowing about, but you probably won't reach for them.
Constraints of GMod's embedded browser
- No interaction — players can't click during loading. Links and buttons are dead; show URLs as plain text.
- No HTML5 video — the embedded browser won't play video reliably; use images or CSS animation.
- Audio autoplay works — unlike desktop browsers, CEF allows autoplay; background music is fine in-game (your dashboard preview still needs a click).
- GMod's download box — the engine draws its own download panel bottom-right (~300×40px). Keep that corner clear or your design gets covered.
- Any resolution — the page renders at the player's full resolution, from 1280×720 to ultrawide. Design responsive.
Troubleshooting sv_loadingurl
- Default screen still shows — check the quotes, confirm the line is in the cfg actually executed, and fully restart the server (a map change isn't always enough).
- Blank / black screen — open the URL in a normal browser first. If it needs JavaScript features CEF lacks, or blocks embedding, it can render empty in-game.
- Mixed content — serve everything over https, including images and audio; http assets on an https page may be blocked.
- Works for you, not for others — your client caches the page. Ask a friend to verify, or test from a second machine.
- Screen shows but no progress — the engine callbacks aren't defined on window, or a JS error killed the script. Check the page's console in a desktop browser.
For a symptom-by-symptom walkthrough, see GMod loading screen not showing? 7 fixes.
The fast path
That's everything sv_loadingurl can do. If you'd rather not build and host the page yourself, Lumescreen gives you a hosted URL with themes, live server data, music and analytics. It's free to start, and the installation is the one line you just learned.