Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get when the place has finished loading?

Asked by
Benbebop 1049 Moderation Voter
4 years ago
Edited 4 years ago

I want to have a loading screen that closes once all the parts and decals have loaded in. I would also like to get how far it is in with a percentage but that is not the most important, how could this be done? Right now I'm just using wait for 10 seconds, sometimes that wont be long enough or be way too long. Could this be done with PrimitivesCount?

1 answer

Log in to vote
1
Answered by
Elixcore 1337 Moderation Voter
4 years ago

Hey, very simple to do this.

First you need a LocalScript in ReplicatedFirst that will hide the default loading screen and replace it with your own, then you simply connect to the game's Loaded event and close the GUI.

There is no surefire method of checking the percentage unless you count the loaded assets by yourself, since there is no roblox-made function for this.

PS: You can also use game:IsLoaded() to check if the game has loaded.

--localscript in replicatedfirst

script.Parent:RemoveDefaultLoadingScreen() -- Remove default loading screen.

-- Replace it with your own GUI here.

game.Loaded:Wait() -- Connect to .Loaded event that will fire whenever the game is finished loading.


--Close GUI now that loading has finished.
Ad

Answer this question