I’ll go with my method of breaking it in case there is 1 player after for loop is broken.
while true do
while true do
for i=60,0,-1 do
if #game.Players:GetPlayers() <2 then
break
end
end
if #game.Players:GetPlayers()<2 then break end
end
end
It’s a fighting game so it should work only when there’s one player. The condition I am preventing is, 2 players before script goes to for loop and in between 1 left. So, the whole code runs if there’s one player after that.
more than 1, and Im restarting it if 1 player left in between. for loop has next fight begins in … i seconds thing. Break breaks only 1 nearest loop right?
also is that your actual code you are using because i believe you are trying to do 60 second rounds and if a player leaves then the match resets
that being said i believe his is what you should do
local function ResetMatch()
-- code that will reset the match
end
local function MatchBegin()
for i=60,0,-1 do
if #game.Players:GetPlayers() <2 then
ResetMatch()
end
wait(1)
end
end
look at the code i edited above when you fire the match function for the 60 second match (i think thats what your trying to have " 60 second matches")
it will loop for 60 seconds and if a player leaves then it will fire the Reset Match Function then you should return break possibly if you want to from the “resetmatch” function