function module.gamemode()
for timer = timeLimit, 0, -1 do
spawn(function()
for _, map in pairs(workspace:WaitForChild("Castle Map"):GetChildren()) do
if map:FindFirstChild("Flag") then
local color = map.Flag.BrickColor
if color == game.Teams.Red.TeamColor then
redFlags = redFlags + 1
elseif color == game.Teams.Blue.TeamColor then
blueFlags = blueFlags + 1
end
end
end
wait(3)
end)
wait(1)
end
end
I'm trying to run 2 seperate for loops at the exact same time, but to have each of them wait a different amount of time. What I want is to have the main for loop running every second, as this is the game countdown clock. However, the for loop inside the spawn() function needs to loop every 3 seconds. Atm, both for loops run off a second, so the team gets + 1 every second, instead of every 3 seconds
Script is inside a ModuleScript as well

1 comment
Works, thank you :D