Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 5 years ago
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

Log in to vote
1
Answered by
0_2k 496 Moderation Voter
5 years ago
Edited 5 years ago

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
0
I'll try to learn this and use it in the future. Thanks! Hwk3rAlt 14 — 5y
0
Anytime 0_2k 496 — 5y
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. EmilyBendsSpace 1025 — 5y
Ad

Answer this question