According to my code, the game NEVER loads

I started my script with a

repeat task.wait(1) until game:IsLoaded()

and I then realized that everything after that the code after that isn’t working.

The output had no errors so I have no idea what’s going on. I put a

print("game is loaded")

after the first repeat block, and the output never displayed that message. I know it’s not a problem with the output because I tried putting the same print block before repeat block and the output did display that message. I’m confused because when I remove that repeat block, errors appear in my code because those things haven’t loaded in yet. Please help me.

I recommend looking into the service ContentProvider to load specific assets that are required for gameplay instead of using game:IsLoaded(). You can check ContentProvider.RequestQueueSize until it falls below a certain number to your discretion. When determining if the game is loaded or if assets are available, then it needs to be in a LocalScript preferably within ReplicatedFirst.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.