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
local function ForLoop ( i, ending, incrementer, numberOfTimesItRanBackAndForth)
if i == 1 then
incrementer = -.1
if numberOfTimesItRanBackAndForth > 0 then
numberOfTimesItRanBackAndForth = numberOfTimesItRanBackAndForth + 1
end
elseif i == 0 then
Incrementer = .1
numberOfTimesItRanBackAndForth = numberOfTimesItRanBackAndForth + 1
end
if numberOfTimesBackAndForth == 2 then
return
end
wait()
brought.TextTransparency = i
i = i + incrementer
return ForLoop(i, incrementer, numberOfTimesBackAndForth)
end
ForLoop(1, -.1, 0)
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.
2 comments
i think u can't
You probably just have to make another loop going from 0-1