Broken Round System consisting of Recursion and Randomizing BrickColor Mechanic

the loop waits until the game is ended
so it will restart when the game is ended (when a player wins)

the recursion psuedocode does the exact same thing as the while loop
its not branching infinitely but just calling itself over and over again
if you draw it then it would be like a circle

i think using the simple loop is better than recursion, but both will work

while true do -- do this forever
  vote() -- make the players vote
  task.wait(15) -- wait until the vote timer runs out
  startGame() -- set up the game

  repeat task.wait() until gameEnded() -- keep waiting until the game ends
end -- restart the loop after the game ends or a player wins
1 Like