How to make all players play at the same time?
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?
01 | local Players = game:GetService( "Players" ) |
03 | local spectating = true |
05 | Players.PlayerAdded:Connect( function (player) |
06 | local debounce = Instance.new( "BoolValue" , player) |
07 | debounce.Name = "GameDebounce" |
10 | if spectating = = true and inGame = = false and not debounce.Value then |
11 | player.Team = game.Teams.Spectators |
12 | print ( "Player is spectating" ) |
14 | print ( "Starting Game" ) |
17 | debounce.Value = false |
18 | elseif spectating = = false and inGame = = true and not debounce.Value then |
19 | player.Team = game.Teams.Players |
20 | print ( "Game has started" ) |
21 | local char = player.Character or player.CharacterAdded:Wait() |
22 | char:SetPrimaryPartCFrame(CFrame.new(Vector 3. new(- 8.92 , - 2.17 , 27.27 ))) |