How would i wait for all the players to be loaded in game for a script to run?

So yeah i basically want a script to run after all the players are loaded in game and i need some suggestions.

This thread seems to solve the problem of being able to tell when a player is loaded in (Here is the broken link). Using remote events and a local script for Player.CharacterAdded:Wait() could also work.

Then you could have an array of loaded-in players, checking if the number of players in the array is the same as the #Players:GetChildren(), as if it is, that must mean they’re all loaded in. A safer way to do this would probably be to just use a dictionary of all the players (adding them on the PlayerAdded event) and a true/false if they’re loaded or not.

repeat wait() until game:GetService("Players").LocalPlayer.Character

This is a LocalScript, not a ServerScript
Put this at the top of your script to make it run after the character is loaded.

I don’t know how to make it work in all server scripts. If you give me an individual server script, I can make it wait for the player to be added through other means.