Instead of going from 30 to 1 by counting down, it goes from 1- inf (infinity)
for i = 30,1 do --Intermission
GameTime = ValuesFolder:WaitForChild("GameTime")
GameTime.Value = i
wait(1)
end
Instead of going from 30 to 1 by counting down, it goes from 1- inf (infinity)
for i = 30,1 do --Intermission
GameTime = ValuesFolder:WaitForChild("GameTime")
GameTime.Value = i
wait(1)
end
When Counting Down, You have To Subtract the i.
You can count up with a for loop the same way you were trying with a switch in value ordering, like so,
for i = 1,30 do --Intermission--counts up
GameTime = ValuesFolder:WaitForChild("GameTime")
GameTime.Value = i
wait(1)
end
This is the same as,
for i = 1,30,1 do --Intermission
GameTime = ValuesFolder:WaitForChild("GameTime")
GameTime.Value = i
wait(1)
end
The extra one is basically always there unless altered. This is what I gets added by each time. So, in order to make the loop count down, we make the number a negative,
for i = 30,1,-1 do --Intermission--counts down
GameTime = ValuesFolder:WaitForChild("GameTime")
GameTime.Value = i
wait(1)
end
That's how I remember anyway.
Good Luck!
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Thanks! I knew how to add the extra i, but I did not think about it.
Extra "1", sorry.