Answered by
4 years ago Edited 4 years ago
It’s the same in terms of runtime if you had two for loops though...
So I don’t see why you would need to.
Also you can manipulate how much you want i to increase by if you don’t include the increment. So you could just say i + .1 in the for loop or i -.1.
Or you could do it recursively which is the fun way
01 | local function ForLoop ( i, ending, incrementer, numberOfTimesItRanBackAndForth) |
04 | if numberOfTimesItRanBackAndForth > 0 then |
05 | numberOfTimesItRanBackAndForth = numberOfTimesItRanBackAndForth + 1 |
09 | numberOfTimesItRanBackAndForth = numberOfTimesItRanBackAndForth + 1 |
11 | if numberOfTimesBackAndForth = = 2 then |
16 | brought.TextTransparency = i |
19 | return ForLoop(i, incrementer, numberOfTimesBackAndForth) |
Look over it and you can understand what it does. You can also set the number of times you want it to go to 0 to 1 and 1 to 0. So if numberOfTimesBackAndForth == 4 it would have went from 1 to 0, 0 to 1, 1 to 0 and 0 to 1.
You can do the same thing I did here in a while loop but without returning. You just have to add if statments and break when it hits a certain amount of loops you want.