I believe the error is at line 6, where it defines the hint's text. The hint's text shows up, but the timer blue and red variables don't go down (they may, but the text on the hint does not change.)
local h = Instance.new("Hint", game.Workspace) TimerBlue = 360 TimerRed = 360 TimerTie = 360 while true do h.Text = "Blue Timer: " ..TimerBlue .." | " .."Red Timer: " ..TimerRed wait(1) end while game.Workspace.AbandonedSkyMill.Point.Light.BrickColor == BrickColor.new("Bright blue") do wait(1) TimerBlue = TimerBlue - 1 if TimerBlue == 0 then break end end while game.Workspace.AbandonedSkyMill.Point.Light.BrickColor == BrickColor.new("Bright red") do wait(1) TimerRed = TimerRed - 1 if TimerRed == 0 then break end end if TimerBlue == 0 and game.Workspace.AbandonedSkyMill.Point.Light.BrickColor == BrickColor.new("Bright blue") then game.Workspace.VictoryDefeat.Value = true end if TimerRed == 0 and game.Workspace.AbandonedSkyMill.Point.Light.BrickColor == BrickColor.new("Bright red") then game.Workspace.VictoryDefeat.Value = false game.Workspace.Red.Value = true end
Where you put
while true do h.Text = "Blue Timer: " ..TimerBlue .." | " .."Red Timer: " ..TimerRed wait(1) end
This is a while loop, and keeps running until the condition (true
) is false. Since true
is true and you can't change it (and it's not a variable either), it won't stop running to go on to the next while. Now since I know you don't want to stop it, put a coroutine around it to "hide" it.
coroutine.wrap(function() while true do h.Text = "Blue Timer: " ..TimerBlue .." | " .."Red Timer: " ..TimerRed wait(1) end end)()
It still does the same thing: no error, here is my new script:
local h = Instance.new("Hint", game.Workspace) TimerBlue = 360 TimerRed = 360 coroutine.wrap(function() while true do h.Text = "Blue Timer: " ..TimerBlue .." | " .."Red Timer: " ..TimerRed wait(1) end end)() coroutine.wrap(function() while game.Workspace.AbandonedSkyMill.Point.Light.BrickColor == BrickColor.new("Bright blue") do wait(1) TimerBlue = TimerBlue - 1 if TimerBlue == 0 then break end end end) coroutine.wrap(function() while game.Workspace.AbandonedSkyMill.Point.Light.BrickColor == BrickColor.new("Bright red") do wait(1) TimerRed = TimerRed - 1 if TimerRed == 0 then break end end end)