This code is meant to print something when the amount of seekers is equal to the amount of players, however it doesn't, even though it says that they are equal.
Code that checks how many players are seekers:
activeseekers = 0
currentseekers = coroutine.create(function()
while true do wait(.5)
for i,v in pairs(plrs:GetChildren()) do
if v.Character:FindFirstChild("Seeker") then
if v.Character.Seeker.Value == true then
activeseekers = activeseekers + 1
else
end
end
end
print("ACTIVE SEEKERS: ".. activeseekers)
print("ACTIVE PLAYERS: ".. playersplaying)
activeseekers = 0
end
end)
coroutine.resume(currentseekers)
It prints active seekers and players are equal when the seeker touches a hider, but the following code doesn't detect that they are equal;
clearmap = coroutine.create(function()
while true do
wait(.01)
if activeseekers == playersplaying and playersplaying >= 1 then
print("All players found!")
end
end
end)
coroutine.resume(clearmap)
Why isn't it working?

3 comments
I set it back to 0 because otherwise it would stack.
How would I make a table and update it when a there's a new seeker?
Okay I figured it out