First off I'm sorry my formating is horrendous I'm very new to scripting. But if you can read and make sense of this how could I go about looping the round part of this while resting my map and saving the dscore.Value and ascore.Value
Pastebin: https://pastebin.com/DRt65E16
I've yet to add a way for the attacking team to win if that means anything im v lost any help will be appreciated <3
Congrats on beginning to script! I'll start by saying that you should definitely have functions here and not just a bunch of free-floating while loops. Furthermore, you should never have more than 1 while true loop. It's difficult to tell what you want with your code, however, I've gone ahead and coded what I interpreted from looking at your code.
I've also reformatted most of your code, hopefully you can see the differences and remember them. The most important would be the unnecessary while true loops that you just end up breaking out of anyway and the false indentation.
local dscore = script.DefenderScore local s = script.Stat local ascore = script.AttackScore local gameStarted = false -- this is intermission local function startGame() t = 5 repeat t = t-1 s.Value = "Game Starting In "..t.." Seconds" wait(1) until t == 0 gameStarted = true s.Value = "Game Starting" wait(2) for i, v in pairs(game.Teams.Orange:GetPlayers()) do v.Character.Head:Destroy() end for i, v in pairs(game.Teams.Blue:GetPlayers()) do v.Character.Head:Destroy() end end local function checkScores() if dscore > 3 then s.Value = "Orange Wins The Game" gameStarted = false end if ascore > 3 then s.Value = "Blue Wins The Game" gameStarted = false end end while gameStarted == true do checkScores() wait(1) end startGame()