This is a small part of my minigame script.

MinigameTime = 20
repeat
	wait(1)                         -- These two make the minigame
	MinigameTime = MinigameTime - 1 -- time clock go down every second.

	ingameplayers = game.Teams["In Game"]:GetPlayers() -- Gets the players on the in-game team.

until MinigameTime < 1 or #ingameplayers < 1

It works fine in test mode, but when this happens on a real server, the minigame doesn't end when the ingame players is 0. Is there a more efficient way of getting how many players are on a team? Also, it doesn't end when the minigame time runs out either.The minigame basically never ends. Anyone know why this happens?

4 comments

2

Try getting it to print every loop. This should theoretically work. Are there any errors in the output?

0

You could use a for loop.

1

The repeat loop is fine.

0

I put some prints in the repeat loop and they didn't print at all. There were no errors or anything, so that means everything that's in the loop isn't running at all