I dont know why but the wait function doesnt seem to be working
while allPlayersAlive() do
wait(2.5)
giveMoneyToPlayers() -- all players in a region give 5$
if allFinish() then -- returns true if all players are in brick region
teleportToStart()
break
end
end
so basically the loops is suppose to wait 2.5 seconds then
get all players in a room (players found using region 3) and give them 5$
then checks the finish region, and if all players are there, teleport them to the start and break the while loop
what is happening is it waits 2.5 seconds and then adds 80$ to the players balance, instead of 5$
im not sure why this is happening please help.

5 comments
What is the "break" for?
Also, I might be able to work out what's going on if you provide the GiveMoneyToPlayers() function.
If it continues to loop and give 80 dollars each time, it seems more like a problem of the cash giving function than the loop.
to exit the loop, i forgot to add after the loop there is a cleanup() function
@Quezzert Just posted the giveMoney() function