Skip to content

CloseLoadingScreen

Ends the loading screen when the game mode keeps it up.

A server’s interface can keep the loading screen over the game past the spawn (manual_shutdown in its ui.toml’s [components.loading]): the screen then stays until the mode’s ClosePlayerLoadingScreen, this call, the loading page’s loading.done, or 240 seconds after the world is ready. A script that has a reason to hold it - a menu of its own that is still being built - closes it here when it is ready. A close that comes before the player has spawned waits for the spawn.

Without that setting the spawn ends the screen and the call changes nothing, and the screen shows once for a run of the game, so it changes nothing later either. true says the request was made; there is no answer to read beyond that - whether the screen was still up is not reported.

CloseLoadingScreen()

boolean - true when the request was made

-- the mode keeps the loading screen up until its own screen is drawn
function OnServerEvent(name, payload)
if name == "menu.ready" then
CloseLoadingScreen()
end
end

OnServerEvent · the The game’s UI for a script group of the index