Trouble with detecting when no players have a tag with a certain value

  1. What do you want to achieve? Keep it simple and clear!
    I want my round script to be able to detect when no players have a tag with a true or false value.

  2. What is the issue? Include screenshots / videos if possible!
    The round is continuing and not stopping when all the tags of a certain value have been removed.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have found nothing similar to my question.

The related area of script:

local numberOn = 0
		local numberOff = 0
		for i = 60, 0, -1 do
			status.Value = "Time Remaining: 2 minutes and "..i.." seconds."
			for index, val in pairs(game.Players:GetPlayers()) do
				if val:FindFirstChild("Tag") then
					if val.Tag.Value == false then
						numberOff = numberOff + 1
					elseif val.Tag.Value == true then
						numberOn = numberOn + 1
					end
				end
			end
			print(numberOn.." players are seekers")
			print(numberOff.." players are hiders")
			if numberOff < 1 or numberOn < 1 then
				break
			end
			wait(1)
		end
		print(numberOn.." players are seekers")
		print(numberOff.." players are hiders")
		if numberOn < 1 then
			status.Value = "The Hiders have won!"
			for i, v in pairs(game.Players:GetPlayers()) do
				if v.Tag then
					v:LoadCharacter()
					v.Tag:Destroy()
				end
			end
		elseif numberOff < 1 then
			status.Value = "The Seekers have won!"
			for i, v in pairs(game.Players:GetPlayers()) do
				if v.Tag then
					v:LoadCharacter()
					v.Tag:Destroy()
				end
			end
		else
			for i = 60, 0, -1 do
				status.Value = "Time Remaining: 1 minute and "..i.." seconds."
				for index, val in pairs(game.Players:GetPlayers()) do
					if val:FindFirstChild("Tag") then
						if val.Tag.Value == false then
							numberOff = numberOff + 1
						elseif val.Tag.Value == true then
							numberOn = numberOn + 1
						end
					end
				end
				if numberOff < 1 or numberOn < 1 then
					break
				end
				wait(1)
			end
		end
		print(numberOn.." players are seekers")
		print(numberOff.." players are hiders")
		if numberOn < 1 then
			status.Value = "The Hiders have won!"
			for i, v in pairs(game.Players:GetPlayers()) do
				if v.Tag then
					v:LoadCharacter()
					v.Tag:Destroy()
				end
			end
		elseif numberOff < 1 then
			status.Value = "The Seekers have won!"
			for i, v in pairs(game.Players:GetPlayers()) do
				if v.Tag then
					v:LoadCharacter()
					v.Tag:Destroy()
				end
			end
		else
			for i = 60, 0, -1 do
				status.Value = "Time Remaining: "..i.." seconds."
				for index, val in pairs(game.Players:GetPlayers()) do
					if val:FindFirstChild("Tag") then
						if val.Tag.Value == false then
							numberOff = numberOff + 1
						elseif val.Tag.Value == true then
							numberOn = numberOn + 1
						end
					end
				end
				if numberOff < 1 or numberOn < 1 then
					break
				end
				wait(1)
			end
		end
		print(numberOn.." players are seekers")
		print(numberOff.." players are hiders")
		if numberOn < 1 then
			status.Value = "The Hiders have won!"
			for i, v in pairs(game.Players:GetPlayers()) do
				if v.Tag then
					v:LoadCharacter()
					v.Tag:Destroy()
				end
			end
		elseif numberOff < 1 then
			status.Value = "The Seekers have won!"
			for i, v in pairs(game.Players:GetPlayers()) do
				if v.Tag then
					v:LoadCharacter()
					v.Tag:Destroy()
				end
			end
		end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

you know, I think the script really din’t work or something.

I ever create a script but it wont works.

Why so much for i pairs scripts thats not how it should be

You should do a for I pairs for the round and inside the round script add another for I v pairs to get player tag it will yield but like 2millisecond

The amount of in pairs that I use should not effect how the script works.