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

How can I make a GUI fade instead of fading out?

Asked by 2 years ago

Hi. I recently got a script to make a GUI fade out. It works very well, however I would also want the GUI to fade in. Basically the opposite of what this script does. How can I make that happen? Thanks.

wait(5)

local frame = script.Parent

wait(12.5)

for i = 1,100 do frame.BackgroundTransparency += 0.01 wait(0.001) end

1 answer

Log in to vote
0
Answered by 2 years ago

You can make the frame transparent by default, and then make it's transparency slowly lower like this:

local frame = script.parent
frame.Transparency = 1

wait(12.5)

for i = 1,100 do
    frame.BackgroundTransparency = frame.BackgroundTransparency - 0.01
end
0
Your loop has no yield, therefore it will complete almost instantly. 'wait' has also been superseded by 'task.wait' Ziffixture 6913 — 2y
Ad

Answer this question