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.
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
Timed mode — fixed duration loading bar
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
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
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).
| Prop | Type | Default | Description |
|---|---|---|---|
| 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. |