Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

It may be:

wait until game.Loaded

end

or

wait until game:IsLoaded

end

IT may be either of those two.

This discussion is preserved as it was. New answers, comments, and votes are closed.