Seems like you have multiple codes within the while loop whose purpose is just to assign teams. Could be that they’re conflicting with one another. Don’t think you need to run it that much. Just some optimization suggestion. Plus, you have loops after loops. For loops within the while loop, and your countdown function also has a loop in it and a wait. I reckon there are more optimal ways to do this.