Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Detect when game loaded for client?

Asked by 5 years ago

So i'm making a game obviously, and i want to have a loading screen that doesn't go way until the game is loaded, i searched this up but couldn't find a answer. Any help is appreciated!

0
game.Loaded DeceptiveCaster 3761 — 5y
0
or game:IsLoaded() DeceptiveCaster 3761 — 5y
0
Depends what you want to check for? Player being fully created? Character having loaded? Assets preloading? Amiaa16 3227 — 5y
0
oh good point DeceptiveCaster 3761 — 5y

1 answer

Log in to vote
0
Answered by
oftenz 367 Moderation Voter
5 years ago

The method I use is to wait until the player is fully loaded. Works just fine for me.

if not game.Players.LocalPlayer.Character or not game.Players.LocalPlayer then
   character = game.Players.LocalPlayer.CharacterAdded:wait()
end

for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
while v == nil do
    wait()
end
end

2 different ways ^^

0
he said the GAME, not the PLAYER. DeceptiveCaster 3761 — 5y
0
Huh? Why would you check if v == nil? GetChildren() cannot return a table with nil as one of the values. Amiaa16 3227 — 5y
Ad

Answer this question