How do i check if the Player's game has loaded fully?

  1. What do you want to achieve: I want to check if the loading screen of roblox’s core gui has faded away before running some scripts. Note that i use a starter character in this game.

  2. What is the issue: I used game.Loaded:Wait() and LocalPlayer.CharacterAdded:Wait(). But those wont work properly. ( I used this functions in a LOCAL script.) The thing is, when i use wait(), it works. But i am not sure if the game would load for the newly added player.

-In the video below, i use game.Loaded:Wait(). The NPC with a tophat should speak below, but it just says Label. Also, this doesnt send any errors in output. (Ignore the cannot teleport error, its related with a different script.)

  • In another video also below this text i just use the wait() function. As you see, the game gets loaded and after some time passed, the NPC speaks as desired. That delay is annoying, and i want for the NPC to speak right after the game loads, instantly.

  1. What solutions have you tried so far? I tried to research in devforum, but couldn’t find any useful info that i can implement.
1 Like

Just using game.Loaded:Wait() has the possibility to yield if the event has already been fired before the local script has loaded – hence, it would be waiting forever.

This is why in the documentation, you can see .Loaded used like:

if not game:IsLoaded() then -- only yield when game hasn't loaded yet
    game.Loaded:Wait()
end
1 Like

Thanks! This worked perfectly as i wanted!