I want to find out when the Roblox loading screen has disappeared
Would there happen to be a function for that?
Thanks
I want to find out when the Roblox loading screen has disappeared
Would there happen to be a function for that?
Thanks
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.
Could you show an example with an if statement script?
if game.IsLoaded then
--do something
end
Oh ok thanks!
You are welcome!
Let me know if you need further assistance.
What @Regen_erate said
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!
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 :
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)
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
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)
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.
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 ,
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
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.
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.
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.