Ok,I made script so when you press a button it fades and then in the last part I added a debounce so it can only be clicked once, but your still able to click it,why?
01 | part = script.Parent |
02 | clicked = false |
03 | part.MouseButton 1 Click:connect( function () |
04 | ---------------Debounce------------------ |
05 | if clicked = = false --Checks if clicked is false(Which it should be,because it already been set false) |
06 | then |
07 | clicked = true -- Since it false it will turn it true(so we know it's alread been clicked) |
08 | end |
09 |
10 | ----------------Fade Out------------------ |
11 | for fo = 0 , 10 do |
12 | wait( 0.1 ) |
13 | part.BackgroundTransparency = fo/ 10 --You need to divide to get the precise number(Other way won't work) |
14 | part.TextTransparency = fo/ 10 |
15 | if fo/ 10 = = 1 |
You need the debounce with the script
01 | part = script.Parent |
02 | clicked = false |
03 | part.MouseButton 1 Click:connect( function () |
04 | ----------------Fade Out------------------ |
05 | if clicked = = true then |
06 | clicked = false |
07 | for fo = 0 , 10 do |
08 | wait( 0.1 ) |
09 | part.BackgroundTransparency = fo/ 10 --You need to divide to get the precise number(Other way won't work) |
10 | part.TextTransparency = fo/ 10 |
11 | if fo/ 10 = = 1 then |
12 | clicked = false |
13 | end |
14 | end |
15 | end |
16 | end ) |