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
What I have is a for loop which cycles through every second to count down the timer. However, I want every 3 seconds to give each team a point, depending who has control of the flag. The script is in a moduleScript

1 comment
I did say what was wrong. I want to have 2 for loops running simultaneously but with different wait times for each. The problem with my script is I dont know how to do that. I tried using a spawn() function, but that still makes the for loop for off 1 second