Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Broken Gui script?

Asked by 9 years ago

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..

local a = game.Players.LocalPlayer.PlayerGui.FNMain.Frame.ImageLabel 

for _ = 0, 1, .1 do
a.ImageTransparency = _
end
0
So, do you want to actually see the fade effect, instead of it cutting to transparent right away? Redbullusa 1580 — 9y
0
Yes, I want it to fade from 1 transparency to 0 transparency (1 being invisible) SprocketSoldier 0 — 9y

2 answers

Log in to vote
1
Answered by
Redbullusa 1580 Moderation Voter
9 years ago

Add a wait() function to see the fade effect.

local a = game.Players.LocalPlayer.PlayerGui.FNMain.Frame.ImageLabel 

-- Disappearing image

for _ = 1, 10 do
    a.ImageTransparency = a.ImageTransparency + .1
    wait(.1)
end

-- Reappearing image

for _ = 1, 10 do
    a.ImageTransparency = a.ImageTransparency - .1
    wait(.1)
end
Ad
Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
9 years ago

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.

local a = game.Players.LocalPlayer.PlayerGui.FNMain.Frame.ImageLabel 

for i = 0, 1, do --Keep this at whole numbers. (.1 wouldn't work)
    a.ImageTransparency = i*.1 --This is where you can change the number to non-whole numbers.
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

0
Yeah man I don SprocketSoldier 0 — 9y
0
Yeah man I don't know..it still won't work..It's an Image Label that I want from 1 transparency to 0 transparency cutting .5 each time. Could roblox have patched it? SprocketSoldier 0 — 9y
0
Broke it from updates* SprocketSoldier 0 — 9y

Answer this question