How do I find out when the Roblox loading screen has disappeared?

I want to find out when the Roblox loading screen has disappeared

Would there happen to be a function for that?

Thanks :smiley:

3 Likes

Use game.IsLoaded or game.Loaded:Connect()

Unfortunately, it (I think) won’t 100% sync up with it disappearing; it returns true/fires whenever the contents of the server are replicated to the client.

1 Like

Could you show an example with an if statement script?

1 Like
if game.IsLoaded then
    --do something
end
3 Likes

Oh ok thanks! :+1: :slight_smile:

2 Likes

You are welcome! :wink:

Let me know if you need further assistance.

3 Likes

What @Regen_erate said :joy:

If you want to make your own custom loading screen you can remove the default loading screen by inserting a local script into replicatedfirst and doing:
game.ReplicatedFirst:RemoveDefaultLoadingScreen()

Then of course make your own gui with the is loaded function! :wink:

2 Likes

No,

You use game:IsLoaded as such, as

game.Loaded and game:IsLoaded describe the existence of static instances, whether they have replicated or not.
but this will check exactly whether the guis have loaded, game:IsLoaded() doesn’t work that way. To make sure the guis have appeared (loading screen basically) you could…
loop through players , and for each player separately if found , then print(“loaded”)
like this :
image

Use a script like this in ServerScriptService :

–Though it is not recommended to check for any reason, whether the guis have loaded here you go :

game.Players.PlayerAdded:Connect(function()
    

   wait(1)
         local plrs = game:GetService("Players")
       local everyone = plrs:GetPlayers()
    
for _,guy in pairs (everyone) do
     
local loaded = Instance.new("BoolValue")
 loaded:Clone().Parent = guy

   if guy:FindFirstChild("PlayerGui")    
       then  print("Guis Loaded")--Loaded!!!
	    loaded.Value=true 
	   return
	  end
	
	 guy:WaitForChild("PlayerGui")--else if not loaded..
	if guy:FindFirstChild("PlayerGui")
	then print("PlayerGuis have loaded")
	end
end
end)
2 Likes

This is what I could come up with, similar to above

local ContProvider = game:GetService("ContentProvider")
if ContProvider.RequestQueueSize == 0 then
   print("Game loaded")
end
4 Likes

I have found an even better way to check whether player Guis have loaded

image

as game:IsLoaded() only checks for static models and objects NOT Gui

I created this script, to be used in ServerScriptService to print whenever guis have loaded for every player.

game.Players.PlayerAdded:Connect(function()
	
	    local players = game:GetService("Players")
	   
	    local playerarray = players:GetPlayers()
	
	for _,player in ipairs(playerarray) do
	  if player:FindFirstChild("PlayerGui") then
		 print("Guis have loaded for" .. player.Name)
	  return
	end
	--if it wasn't found then
	repeat
	   player:WaitForChild"PlayerGui"
	until
	player:FindFirstChild("PlayerGui")
	        if player:FindFirstChild("PlayerGui") then
		print("Now Guis have loaded for" .. player.Name)
	  end
	end
end)
2 Likes

To be quite honest, I don’t see why you have the need to run this for every player, every time a new player joins.

1 Like

Well I dont really see the need to do all this in the first place

anyways, I do it for everyplayer , so that we know when exactly all the guis have loaded for an individual player.
For example if we would want to run a function for a player as soon as his guis have loaded , we would need to figure out when they did for himself, not just any random player.
I don’t quite see why we would have the need to check whether Guis have loaded for just one player ,

2 Likes

We could check whether the game has entirely loaded like this , and how many assets are required

local assets = game.ContentProvider
while assets.RequestQueueSize > 0 

	textlabel.Text = loadText.. ", " ..assets.RequestQueueSize.. " left..."
	if assets.RequestQueueSize == 0 then
		print("successfully loaded everything")
		break
	end
1 Like

Roblox doesn’t provide a way to natively check when the loading screen disappears. That being said, the way they do it internally is to wait for game.IsLoaded to return true as well as for the character to first load. Here is the loading CoreScript:

The behaviour for RemoveDefaultLoadingScreen is also in there. Whether the function is called or not, if there are instances in ReplicatedFirst, it will have a hardcoded wait of 5 seconds before removing itself.

A comment as well for the others: DO NOT USE REQUESTQUEUESIZE FOR LOADING SCREENS. This will simply result in longer load times which are terrible for UX. RequestQueueSize is a dynamic property that describes how many assets are left to download: in massive games, this can get awful to bear.

4 Likes

Umm, about the last comment. I am aware of this but…

I don’t think it is related to this question that is necessary to know if you wanna make a CUSTOM loading screen but it CAN be used to check if the DEFAULT loading screen has disappeared (since it is similar to isloaded). He is in no way attempting to make a custom loading screen.

1 Like

That is a heavy misconception. Replication of instances is not the same as waiting for the download queue to be empty. IsLoaded and RequestQueueSize cannot be used similarly or interchangeably and the latter should not be used at all if you hope to make an effective loading screen.

RequestQueueSize will not give you when the loading screen disappears, nothing will because again, such behaviour is not natively supported. The loading screen internally implements IsLoaded and waits for the character to load to determine when to complete loading and hide the Gui; this same pattern can be adopted in your custom loading screens if you decide to make them.

2 Likes