Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i make this script function correctly(trying to end round for a minigame)?

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 answer

Just add the repeat the until and the variable when you want it to stop.

1 comment

0

Tried it and it doesn't work

This discussion is preserved as it was. New answers, comments, and votes are closed.