Using that much code is very unnecessary, and just makes it look inefficient; there's a better way of going about fixing your code, however, I would like to address the problem w/ your code:
Problem: You created a function that would change the Text Transparency; that is not a bad idea, however, it lead to using a lot of unnecessary code.
This can be fixed, however, by using a For loop (not the Generic For loop). The For code should look something like this:
for i = START_VALUE, END_VALUE, ADJUSTMENT_VALUE do
print('Yo. c:')
end
Now, to explain the For loop: the for loop is somewhat like the While loop and Repeat loop, however, they're different by one big difference: the for loop starts w/ a start value (being START_VALUE), and ends w/ an end value (being END_VALUE), and when the start is equal to the end (or pretty close), the looped code will automatically stop running; another advantage is that you can change its adjustment; 1 is its default adjustment value, however, you can change it (the value being ADJUSTMENT_VALUE ).
Now, w/ all that out of the way, let us begin the process!
function c(value)
script.Parent.TextStrokeTransparency = value
wait(0.05)
end
Note: There's no need to edit your function, as we can keep it the same way; all we have to do is change what's within the While loop. :)
function c(value)
script.Parent.TextStrokeTransparency = value
wait(0.05)
end
while true do
for i = 1, 0, -0.1 do
c(i)
end
for i = 0, 1, 0.1 do
c(i)
end
end
And... Ta-da! All done! :D
I really hoped this helped you w/ your question. :)
3 comments
I take it I answered the question? :D
Thanks! :D
@BunnyFilms1 Np! :D