while istime >= 0 or noplayer ~= 1 do
istime -= 1
if game.Workspace.AlreadyChecked.Value == true then
game.Workspace.AlreadyChecked.Value = false
game.Workspace.ClearedPerson.Value = 0
end
wait(1)
for _, team in pairs(teams) do
local players = team:GetPlayers()
if team.Name == "Game" then
if #players == 0 then
noplayer = 1
print(noplayer) -- debugging
wait(3)
break
end
end
end
end
It looks alright, but it all just depends on first, how large the istime variable is (it’s not shown in your script), and second, if the noplayer variable is getting changed correctly.
With that print(noplayer) that you did for debugging, did it print?
So it seems that the problem is with whether or not the conditions of the while loop are being met.
Also, try changing that section you gave us of the script to this (added prints) to see what istime is equal to as it prints. Here:
while istime >= 0 or noplayer ~= 1 do
istime -= 1
print(istime) -- debugging
if game.Workspace.AlreadyChecked.Value == true then
game.Workspace.AlreadyChecked.Value = false
game.Workspace.ClearedPerson.Value = 0
end
wait(1)
for _, team in pairs(teams) do
local players = team:GetPlayers()
if team.Name == "Game" then
if #players == 0 then
noplayer = 1
print(noplayer) -- debugging
wait(3)
break
end
end
end
end
Isn’t that how it’s supposed to work? Take a look.
Right here you say if it’s equal to or greater than 0 then make istime itself minus one. So when istime hits 0, it will subtract 1 from istime and run that one last time. Thus, you get istime being equal to -1.
If you don’t want it to say -1, then just do while istime > 0 instead.