So I know I've asked a ton of questions on this but even though I have been tinkering around a lot with this script I need someone who knows what they're doing better than I do. Using this script I would like it to display a message when either the time runs out or they're are no "infected" players.
function survivor_finish(text,time)
time_left = 20--just to test with
while time_left >= 0 do
time_left=time_left-1
wait(1)
print(time_left)
if #getTeam(Game.Teams.Infected) == 0 or time_left==0 then
m=Instance.new("Message",Workspace)
m.Text = text
wait(time)
m:Destroy()
end
end
end
survivor_finish("Time has run out, survivors win!",3)
Thanks!

6 comments
Can you describe what this does maybe?
There are 20 seconds per round; if all the Infected die, we say "survivors" wins; otherwise "infected" win. Though I just realized I had a mistake in the condition on line 7, sorry about that, it's fixed now
Can I make it so it is checking for a winner during the while loop?
Of course, that is what this is doing currently, and you could also add additional conditions.
It seems to wait for the time to be over for the message to be displayed. I'll check again.
Yeah it waits for the time to end then it displays the message