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

How to make a transparency part?

Asked by
DAHUI84 25
6 years ago

How to simplify this?

script.Parent.Transparency = 0.1
script.Parent.Transparency = 0.2
script.Parent.Transparency = 0.3
script.Parent.Transparency = 0.4

ect..

2 answers

Log in to vote
0
Answered by 6 years ago

It's pretty simple!

for i = 0, 10 do
    script.Parent.Transparency = script.Parent.Transparency + 0.1
    wait()
end
1
Thanks:3 DAHUI84 25 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

I'd recommend using a numeric for loop.

for i = 0, 1, .1 do -- 0 is starting, 1 is desired, .1 is increment
    script.Parent.Transparency = i
    wait()
end

Answer this question