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

Is there any function that waits for the player to load in?

Asked by 2 years ago

The title says it all, But all I need is a line of code that checks to see the player is loaded in, then starts the rest of the script. thanks

2 answers

Log in to vote
0
Answered by 2 years ago

I believe "PlayerAdded" is what you're looking for.

local players = game:GetService("Players")

players.PlayerAdded:Connect(function()
    -- Your code here.
end)

I don't think this does exactly what you want, but it runs when the player loads in.

Ad
Log in to vote
0
Answered by 2 years ago

It may be:

wait until game.Loaded

end

or

wait until game:IsLoaded

end

IT may be either of those two.

Answer this question