Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Broken Gui script?

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

2 comments

0

So, do you want to actually see the fade effect, instead of it cutting to transparent right away?

0

Yes, I want it to fade from 1 transparency to 0 transparency (1 being invisible)

2 answers

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

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

3 comments

0

Yeah man I don

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?

0

Broke it from updates*

This discussion is preserved as it was. New answers, comments, and votes are closed.