SlateUI
DocsComponentsGitHub
Install SlateUI Plugin
SlateUI
DocsComponentsGitHub
Install SlateUI Plugin

Components

  • installation
  • button
  • inputs
  • notification
  • progressbar
  • loading
  • proximity
  • router
Component

LoadingService

A full-featured loading screen controller. Fades in the GUI, drives a progress bar while preloading assets or counting down a fixed duration, then fades out and destroys itself.

Overview

LoadingService.Start() accepts either an asset table or a plain number (duration in seconds). In asset mode it preloads each asset via ContentProvider and updates a ProgressBar live. In duration mode it advances the bar over time. Both modes call an onComplete callback when finished. A skip safety fires automatically after 5 seconds if preloading stalls.

Asset preload mode

luau
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- LocalScript inside a ScreenGui
local LoadingService = require(game.ReplicatedStorage.SlateUI.LoadingService)
 
local assetsToLoad = {
"rbxassetid://123456789",
"rbxassetid://987654321",
}
 
LoadingService.Start(script.Parent, assetsToLoad, function()
-- All assets loaded — transition to game
LoadingService.UpdateStatus("Done! Entering world…")
task.wait(0.5)
LoadingService.Exit()
end)

Timed mode — fixed duration loading bar

luau
1
2
3
4
-- Show a 3-second cinematic loading bar
LoadingService.Start(script.Parent, 3, function()
LoadingService.Exit()
end)

Updating Status Text

UpdateStatus() sets the Status TextLabel in real time. It uses a fast fade-in by default. Pass { typewriter = true } in opts for a character-by-character reveal effect.

Status messages during loading

luau
1
2
3
4
5
-- Immediately update the status label
LoadingService.UpdateStatus("Connecting to server…")
 
-- Or with typewriter effect
LoadingService.UpdateStatus("Loading world data…", { typewriter = true })

Advanced — Multi-Phase Loading

Call UpdateStatus() between logical loading phases to give players feedback. The skip timeout only applies from the moment Start() is called, so long sync operations won't leave the screen stuck.

Multi-phase with status updates

luau
1
2
3
4
5
6
7
8
9
10
LoadingService.Start(script.Parent, coreAssets, function()
LoadingService.UpdateStatus("Assets ready. Building world…")
 
-- Simulate world-build step
task.wait(1)
 
LoadingService.UpdateStatus("Done!")
task.wait(0.4)
LoadingService.Exit()
end)

GUI Hierarchy Required

The guiObject (passed as the first argument) must be parented to a CanvasGroup for the fade effect. It should also contain: Status (TextLabel), optionally Logo (Frame/ImageLabel for scale-out on exit), and optionally ProgressBar (a frame compatible with ProgressBarService).

API

PropTypeDefaultDescription
Start(gui: GuiObject, assetsOrDuration: {Instance} | number, onComplete: () -> (), opts?: table)—Fades in the GUI and begins loading. Calls onComplete when done.
UpdateStatus(message: string, opts?: { typewriter: boolean? })—Updates the Status label. Use typewriter = true for a reveal animation.
Exit() -> ()—Fades out the GUI, scales the Logo up, waits, then destroys the root frame.