Basically, at the end of every game, since this while true do loops, I want it to respawn the players, and randomize their teams. Regular teams, red and blue. Please help, thank you (:
(I cut off some of the script since it was so long lol)
display = game.Workspace.display
music = game.Workspace.Music
sound = game.Workspace.Sounds
quarter = game.Workspace.quarter
countdown = game.Workspace.countdown
whatever = game.Workspace
lol = game.Lighting
while true do
wait(3)
quarter.Value = "OT"
display.Value = "Overtime"
wait(3)
whatever.shotclock.Value = 26
display.Value = ""
sound.Count.Pitch = 5
sound.Count:Play()
c=game.Players:children()
for i=1, #c do
if c[i].TeamColor==BrickColor.new("Bright blue") then
c[i].Character:moveTo(workspace.pos3.Position, workspace.pos3) --Position
elseif c[i].TeamColor==BrickColor.new("Bright red") then
c[i].Character:moveTo(workspace.pos4.Position, workspace.pos4) --Position
end
end
countdown.Value = "3 (Tip)"
wait(1)
sound.Count:Play()
countdown.Value = "2 (Tip)"
wait(1)
sound.Count:Play()
countdown.Value = "1 (Tip)"
wait(1)
sound.Count.Pitch = 8
sound.Count:Play()
countdown.Value = "Start!"
wait(1)
countdown.Value = ""
lol.LBA_Ball10:clone().Parent = whatever
whatever.time.Value = 180
wait()
whatever.STimer.Disabled = false
while whatever.time.Value ~= 0 do
wait()
end
whatever.STimer.Disabled = true
sound.Buzzer:Play()
display.Value = "Overtime has ended!"
wait(3)
if whatever.red.Value > whatever.blue.Value then
display.Value = "The CLE Cavaliers win the championship with " ..whatever.red.Value.. " points!"
wait(3)
display.Value = ""
elseif whatever.red.Value < whatever.blue.Value then
display.Value = "The GS Warriors win the championship with " .. whatever.blue.Value.. " points!"
wait(3)
display.Value = ""
elseif whatever.red.Value == whatever.blue.Value then
display.Value = "The game is tied both teams scoring " ..whatever.red.Value.. " points!"
wait(3)
display.Value = "It's an automatic tie!"
wait(3)
end
whatever.removal.Value = true
wait(3)
whatever.removal.Value = false
whatever.red.Value = 0
whatever.blue.Value = 0
quarter.Value = "-"
wait()
end
end
