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?
COMMUNITY QUESTION
Wait for players to teleport and load?
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.

1 comment
I only know how to do 1 player but not multiple