I want the surface gui button fade out when clicked and the wait about 2 minutes then fade in,but it just keeps looping for a long time.
01 | b = script.Parent |
02 | b.MouseButton 1 Click:connect( function () |
03 | for n = 0 , 1 , 0.1 do |
04 | wait( 0.1 ) |
05 | b.BackgroundTransparency = n |
06 | b.TextTransparency = n |
07 | if n = = 1 |
08 | then |
09 | break |
10 | end |
11 | for i = 1 , 0 ,- 0.1 do |
12 | wait( 0.1 ) |
13 | b.BackgroundTransparency = i |
14 | b.TextTransparency = i |
15 | if i = = 0 then |
16 | break |
17 | end |
18 | end |
19 | end |
20 | end ) |
01 | b = script.Parent |
02 | debounce = false |
03 | b.MouseButton 1 Click:connect( function () |
04 | if not debounce then |
05 | debounce = true |
06 | for n = 0 , 1 , 0.1 do |
07 | wait( 0.1 ) |
08 | b.BackgroundTransparency = n |
09 | b.TextTransparency = n |
10 | end |
11 | wait( 120 ) |
12 | for i = 1 , 0 ,- 0.1 do |
13 | wait( 0.1 ) |
14 | b.BackgroundTransparency = i |
15 | b.TextTransparency = i |
16 | end |
17 | debounce = false |
18 | end |
19 | end ) |
Something of this sort.