I have this script right here..
1 | script.Parent.Parent.TextButton.MouseButton 1 Click:Connect( function () |
2 | for loop = 1 , 10 do |
3 | wait( 0.01 ) |
4 | script.Parent.BackgroundTransparency = loop/ 10 |
5 | game:GetService( "RunService" ).Stepped:Wait() |
6 | end |
7 | end ) |
And it makes a frame's "BackgroundTransparency" go from 1 to 0. But how do I make that go from 0 to 1 and then wait for a few seconds and then from 1 back to 0?
Thanks for your time.
This is an example of incorrect use of transparency values
1 | gui = -- Gui location |
2 |
3 | for trna = 10 , 0 ,- 1 do |
4 | gui.BackgroundTransparency = trna |
5 | gui.TextTransparency = trna |
6 | wait( 1 ) |
7 | end |
So Basically transparency works 0 to 1 not 0 to 10 so divide the end number and interval by ten. I have used "TextTransparency" guessing that whats your using but if its an image you can use "ImageTransparency". Example:
1 | gui = -- Gui location |
2 |
3 | for trna = 1 , 0 ,- 0.1 do |
4 | gui.BackgroundTransparency = trna |
5 | gui.TextTransparency = trna |
6 | wait( 1 ) |
7 | end |
If this helped please up vote and accept answer, lets help each other out