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

How do I check if the player is really in the game?

According to some experimenting I did, while the player is still in the "loading into the game" Roblox loading screen, the player already exists.

This can be a little troubling since I want certain things to happen right after the loading screen goes away.

My current method is adding a wait(3.97)

However, this may not work depending on the amount of time it takes the player to load in to the game, but I'm not sure.

Am I doing it the correct way, or is there a better option?

1 answer

Use an event of Players service called PlayerAdded the event fires everytime a player joins the game, and it even gives you reference to the player object of the player that joined the game: for instace

local Players = gam:GetService("Players")
Players.PlayerAdded:Connect(function(player)
	print("Welcome to the server, ",player.Name)
end)

now when a player joins it will print out Welcome to the server [name of player that joined the game

for instance: welcome to the server, badcc

5 comments

0

Didn't work. It printed the welcome message before the loading screen even appeared.

0

umm, isnt that what you?

0

I'm trying to get it to do something once the loading screen disappears. The player's object gets added before the loading screen disappears.

0

maybe try game:IsLoaded() on a LocalScript?

0

or what I sometimes do is wait for the character

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