Hey so I want to make my Gui go from 1 transparency to 0 transparency decreasing by .5 everytime.. I have been trying a lot of different things, and this script I'm about to show you was the only one that actually did anything, but it's not working properly, it just keeps the image at 1 transparency..
1 | local a = game.Players.LocalPlayer.PlayerGui.FNMain.Frame.ImageLabel |
2 |
3 | for _ = 0 , 1 , . 1 do |
4 | a.ImageTransparency = _ |
5 | end |
Add a wait() function to see the fade effect.
01 | local a = game.Players.LocalPlayer.PlayerGui.FNMain.Frame.ImageLabel |
02 |
03 | -- Disappearing image |
04 |
05 | for _ = 1 , 10 do |
06 | a.ImageTransparency = a.ImageTransparency + . 1 |
07 | wait(. 1 ) |
08 | end |
09 |
10 | -- Reappearing image |
11 |
12 | for _ = 1 , 10 do |
13 | a.ImageTransparency = a.ImageTransparency - . 1 |
14 | wait(. 1 ) |
15 | end |
You can't have the for
command set up like that. As far as I know, you can only use whole numbers. Try something like this. I'm substituting "i" for the "_" you had.
1 | local a = game.Players.LocalPlayer.PlayerGui.FNMain.Frame.ImageLabel |
2 |
3 | for i = 0 , 1 , do --Keep this at whole numbers. (.1 wouldn't work) |
4 | a.ImageTransparency = i*. 1 --This is where you can change the number to non-whole numbers. |
5 | end |
Anyways, this should work. You didn't have much wrong with the script, just the wrong idea of using it. If you have any problems or questions, please leave a comment below. Hope I helped :P