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

How do you wait until they Player is fully loaded?

Asked by
oftenz 367 Moderation Voter
6 years ago

Hello everyone I am trying to wait until the player has fully loaded in and can view my Intro. It needs to start as soon as the player can view their screen. Any help? I'm currently doing:

local LocalPlayer = game.Players.LocalPlayer
while LocalPlayer == nil do
  wait()
end

3 answers

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

Your problem is that you're waiting for the Player to load instead of the Character. The Player is the first thing to load in when you join a game. The other stuff like the Character and its children which is Body Parts, Accessories, Clothes, etc are what load after.

for i,v in pairs (LocalPlayer.Character:GetChildren()) do
while v == nil do
    wait()
end
end
Ad
Log in to vote
1
Answered by 6 years ago
local player = game.Players.LocalPlayer

workspace:WaitForChild(player.Name)

--type the rest of the intro code here
0
Bro read my question before replying with this. My code is the same as yours. oftenz 367 — 6y
1
then could you be more clear with your question, what exactly do you mean "wait until the player has loaded in" or, "needs to start as soon as the player can view their screen" im_Draco 3 — 6y
Log in to vote
1
Answered by 6 years ago

You can just do couple of things:

local plr = game.Players.LocalPlayer
game.workspace.WaitForChild(Player.Name)
local plr = game.Players.LocalPlayer
plr:Load()
wait(5)

You can also wait until the server started up or when player is added.

Answer this question