It sounds like a stupid question I know and I'm probably stupid for not knowing the answer. I am making a custom loading screen and all seems well but when you join the game the screen goes down immediately. Maybe my connection is a bit fast or something like that. My main question is whether or not the queue size is zero as soon as the player joins because if so, that would explain why it drops down immediately, since the script waits for the queue size to be zero before tweening the GUI away. One last bit of info, I am using RequestQueueSize for this script.
local cp = game:GetService("ContentProvider")
local replicatedfirst = game:GetService("ReplicatedFirst")
replicatedfirst:RemoveDefaultLoadingScreen()
local newloading = game.ReplicatedFirst.Loading:Clone()
newloading.Host.Display.Text = message
newloading.Parent = game.Players.LocalPlayer.PlayerGui
local assets
local function update()
assets = cp.RequestQueueSize
newloading.Host.Asset.Text = "Assets left: "..assets
return assets
end
while true do
wait(0.016666666)
local determine = update()
if determine == 0 then
break
end
end
script.Parent.Loaded.Value = true
newloading.Host:TweenPosition(UDim2.new(0,0,1,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 1)
wait(1.5)
newloading:Destroy()

4 comments
Where does it actually start? Because if your local function is set when your script is already loading then I think it won't work.
It starts at the while true do loop
u gotta use a coroutine at line 20 because once there is a loop not inside a thread, anything after the loop wont work
Why would a coroutine be needed? Once determine = 0 the loop breaks and the code under it will run, which is what I want.