What can i do to make a localscript wait until the client loads properly?

(i am working on this in a local file, i am unsure if this issue would also happen in a roblox player instance)

Okay, this seems like something very simple that i’m somehow overlooking, i’m trying to make a UI “startup screen” for a game, which shows a sequence of images before showing the menu, but my issue is here, that the script happens to load and run before the default roblox loading screen leaves, which makes everything that was meant to be displayed already have gone by when the loading screen disappears, which is not what i’m trying to do, as i stated before, i’m not sure if this issue would happen in a published game, but it happens in studio playtests.

still, i want to see if i can find a solution for this, as it’s happened to me in some of my older games, in almost the same context.

so yeah, thanks in advance! i’m maybe just a little bit stupid

2 Likes

repeat wai() until game.Loaded or game:IsLoaded()

3 Likes

Use game:IsLoaded(). If the property returns false, use the game.Loaded:Wait() event to wait until the game fully loads.

local isLoaded = game:IsLoaded() or game.Loaded:Wait()
3 Likes

You can also do this in addition to the solutions the two other people provided you:

script.Parent:RemoveDefaultLoadingScreen() -- guessing the local script is in ReplicatedFirst

You should also store your loading screen script in ReplicatedFirst, that way the script runs before anything else and the loading screen is more immediate.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.