I want to make a for loop that it increases the transparency of GUI until it is invisible. Can someone give me the code or explain to me how to do it?
We start the for loop at 0 and make it go to 1 at a rate of .01 per wait()
function run() for i=0, 1, .01 do ui.Transparency=i wait() end end button.MouseButton1Click:Connect(run)
Transparency is a number from 0 to 1 so we need to slowly increase the number to see a result, hence the .01
This is basically it just add some more stuff if you have more frames or textlabels or that stuff and the condition and yeah.
local ScreenGUI = script.Parent local frame = ScreenGUI.Frame local TextLabel = frame.TextLabel for i = 1, 10, 1 do frame.BackgroundTransparency = frame.BackgroundTransparency + 0.1 TextLabel.BackgroundTransparency = TextLabel.BackgroundTransparency + 0.1 TextLabel.TextTransparency = TextLabel.TextTransparency + 0.1 wait(0.1) end
If you have any questions ask in the comments