Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make all players play at the same time?

Asked by 4 years ago

How do I make the script so that when a server is created the spectating value is running at the same time because it seemed like if a player was waiting and a new player joined the old player would be in the game before the new player?

01local Players = game:GetService("Players")
02 
03local spectating = true
04local inGame = false
05Players.PlayerAdded:Connect(function(player)
06    local debounce = Instance.new("BoolValue", player)
07    debounce.Name = "GameDebounce"
08    while true do
09        wait()
10        if spectating == true and inGame == false and not debounce.Value then
11            player.Team = game.Teams.Spectators
12            print("Player is spectating")
13            wait(30)
14            print("Starting Game")
15            spectating = false
View all 26 lines...

Answer this question