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

Wait for players to teleport and load?

I am making a horror game that can be singleplayer or multiplayer. However, I want to play a cutscene for all players after they all join and load into the server. How would I go about waiting for players?

1 comment

0

I only know how to do 1 player but not multiple

1 answer

I am pretty sure you would just loop through all the players and see if they have a character, which would mean they are loaded, I am pretty sure something like this should work.

local Players = game:GetService("Players)

for _, player in pairs(Players:GetChildren()) do -- Loops through all the players 
	repeat wait() until player.Character -- Sees if they have a character if not then repeat again to see if they have it.
end

-- Code here after all players characters are there or if they are all loaded in

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