I just made a script to do a loading script. So I'm asking two questions:
local assets = game.ContentProvider.RequestQueueSize -- it loads immediately the total assets the game has to load and stores it. Doesn't update.--
script.Parent:RemoveDefaultLoadingScreen()
local frame = game.ReplicatedFirst.LoadingGUI:Clone()
frame.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local speed = 0.1 -- It stores the rotation speed --
while game.ContentProvider.RequestQueueSize > 0 and speed < 50 do
local assetys = game.ContentProvider.RequestQueueSize -- it loads immediately the assets the game still didn't load. Updates every loop. --
frame.Frame.MovingTyre.Rotation = (script.Parent.Rotation-speed)
speed = (speed*2) -- Doubles the rotation speed (until it reaches the speed of 50)
wait()
frame.Frame.LoadingLabel.Text = "Loading assets... Progress: "..(((assets - assetys)/assets)*100).."%"
-- If there were 10000 instances to load and 3500 are still loading: (((1000-3500)/10000)*100) == (6500/10000)*100 == 0.65*100 == 65% complete --
-- Then, of these 10000 instances, 2650 are unloaded yet: (((1000-2650)/10000)*100) == (7350/10000)*100 == 0.735*100 == 73.5% complete --
end
while game.ContentProvider.RequestQueueSize > 0 do
local assetys = game.ContentProvider.RequestQueueSize
frame.Frame.MovingTyre.Rotation = (script.Parent.Rotation-speed)
frame.Frame.LoadingLabel.Text = "Loading assets... Progress: "..(((assets - assetys)/assets)*100).."%"
wait()
end
frame.LoadingLabel.Text = "Game Loaded. Preparing to spawn..."
while speed > 0 do
local assetys = game.ContentProvider.RequestQueueSize
frame.Frame.MovingTyre.Rotation = (script.Parent.Rotation-speed)
speed = (speed-.2) -- It will gradually slow down the rotation speed until it reaches zero.
wait()
end
wait (2.5)
frame.Parent = nil
Q1: Line 1 - Will the assets value update when the QueueSize updates?
Q2: I stored the GUI on ReplicatedFirst. What happened? The GUI appeared as a StarterGUI. SO I want to do an important question: Can we make the loading of Players first, then Workspace?? On other words, why is the LoadingScreen just loading when everything is loaded?? Can we solve it? :)

4 comments
Why are you using two while loops inside a while loop inside a while loop??? You know you can only run one while loop at a time unless you use another thread?
I edited the script. Is it better now?
Still a lot of while loops. Try using coroutines.
I'll attempt to fix the script myself. I think i know what's wrong.