So I have the character anchored when he joins, and they're meant to stay there until everything has loaded. How do I check to make sure everything's been loaded before letting the player play?
How would I wait until everything's rendered/loaded?
3 answers
There is a way to do this actually. A DataModel (i.e. Service) called ReplicatedFirst runs before everything is loaded.
Another DataModel called ContentProvider has the property RequestQueueSize.
When RequestQueueSize hits 0, that means everything in the game has loaded (Decals, Parts, etc.).
Since scripts are run only Locally in ReplicatedFirst, it will run only on the client, so it won't worry about any other computers running on the game.
Check this out:
LocalScript directly inside ReplicatedFirst:
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local torso = character:WaitForChild("Torso")
torso.Anchored = true --Anchoring the torso, or the entire character.
repeat wait() until game.ContentProvider.RequestQueueSize > 0 --This line will make it wait until everything is loaded.
torso.Anchored = false --Unanchoring the torso, or the entire character.
Be a little more specific, tell us what you want loaded.
4 comments
All the scripts/bricks pretty much. How long would I have to wait before everything's rendered?
Well go ahead and test it out. Joine the game, see how long it takes before its fully functional. Then put a wait and un-anchor the people.
Everyone's computer/Internet is different and loads at different speeds. So just adding a wait won't help with a very fast or a very slow computer or Internet.
Isn't that what to loading screen is for? "Joining game" and when it shows the connectors/Bricks/etc its loading everything/ You don't have to do anything really.
Currently there isen't a way to find this. Using wait in this case will just make it after a period of time. However many computers are different from yours. I suggest just not doing this.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Genius man! Thank you :)
Np. :)
Hold on, if I'm waiting until requestqueue hits 0, would I set it equal to 0 rather than checking if it's greater than 0?
It would be practically the same thing.