I was thinking of doing something like this :
local player = game.Players.LocalPlayer repeat wait() until player.Character local character = player.Character while true do repeat wait() until game.ContentProvider.RequestQueueSize > 0 --This line will make it wait until everything is loaded. end print("it took".. game.ContentProvider.RequestQueueSize.. "to load" --repeat wait() until game.ContentProvider.RequestQueueSize > 0 --This line will make it wait until everything is loaded.
But i realized that it was all non sense and i don't actually know how, even after i tried,
Anyone mind helping me out?
First of all, you need to get rid of your while loop. It's redundant.
Secondly, compare the RequestQueueSize with the proper constructor: ==
Now, for this you should take advantage of the tick function.
Here is an example of it's usage:
local before = tick(); --Before the action print("Hello world"); local after = tick(); --After the action print(after-before) --Difference between the two
To apply this to your case, define a tick
function proceeding & preceding the repeat
loop :)
local player = game.Players.LocalPlayer repeat wait() until player.Character local character = player.Character local before = tick(); --Preceding tick function repeat wait() until game.ContentProvider.RequestQueueSize == 0 local after = tick(); --Proceeding tick function print("it took "..after-before.." to load");