Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make the transparency from 1 to 0 without using a super long script?

wait(30)
script.Parent.TextLabel.TextTransparency = 0.99
script.Parent.TextLabel.TextTransparency = 0.98
script.Parent.TextLabel.TextTransparency = 0.97

I want this script to go from 1 transparency to 0 without using the 0.99 all the way down to 0.01, is there a way to do it?

1 answer

✓ Accepted answer

The for i loop is what you're looking for, here's the general idea.

wait(30)
for i = 1, 0, -0.01 do -- 1; start number, 0; end number, -0.01; increment(increase/decrease by)
	script.Parent.TextLabel.TextTransparency = i
end

3 comments

0

I'll try to learn this and use it in the future. Thanks!

0

Anytime

0

This script and the original both have the same problem in that they don't yield, so you won't see a fade. You should use TweenService. Also, non-integral for loops are a bad idea, they often won't set the final value you expect.

This discussion is preserved as it was. New answers, comments, and votes are closed.