function check()
local red = 0
for i,v in pairs(game.Players:GetPlayers()) do
if a.TeamColor == BrickColor.new("Bright red") then
red = red + 1
end
end
if red == 0 then
endgame1()
end
local blue= 0
for i,v in pairs(game.Players:GetPlayers()) do
if a.TeamColor == BrickColor.new("Bright blue") then
blue = blue + 1
end
end
if blue == 0 then
endgame2()
end
if game.Workspace.Countdown.Message.Text == ("00:00:00") then
endgame3()
end
wait()
check()
end
check()
i would like for it to keep looping and for it to be a function because i want to be able to call it during my main function thanks!

1 comment
Tried it and it doesn't work