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

[GUI] How to fade away text from GUI?

So far I have made the script so it clones the GUI into the players starterGUI, however, I wan't the gui text to fade away after a couple seconds. This is what I have;

`local Gui = game.Lighting.Gui1

function GiveGui(Player)
if Player.PlayerGui:FindFirstChild(Gui.Name)~=nil then return end
Gui:Clone().Parent=Player.PlayerGui
end

script.Parent.Touched:connect(function(hit)

local Player=game.Players:GetPlayerFromCharacter(hit.Parent)
if Player==nil then return end
GiveGui(Player)

end)`

I want to add a function that calls the gui transparency specifically to the text. and slowly and seemily fades away, however i cant do this, could anyone help me?

3 answers

game.StarterGUI.GUI.Frame.Text.Transparency = 0.9
wait(--INSERT LEGNTH HERE)
game.StarterGUI.GUI.Frame.Text.Transparency = 0.8

Correct me if I am wrong. As I am a novice myself.

2 comments

0

This doesn't work because the script calls to clone into the players GUI backpack, so I would have to call to there but no idea how. Q.Q

0

Interesting. You'd probably have to ask someone less Novice then I.

I'm not quite sure about this, but I'm almost sure this would work if not be close to the right idea.

Put a localscript inside the frame and set this as the script

wait(3) --causes the script to wait 3 seconds before starting the fading
frame = script.Parent

for i = 1, 50 do
	wait(1/20)
	frame.TextTransparency = frame.TextTransparency + .02
end

This would cause the text to fade away over a period of 2.5 seconds after being visible for 3 seconds. To speed it up, set the wait to wait() or from 1/30-1/21, to slow it down set the wait anywhere from 1/19-1(I recommend you don't slow it down, otherwise it will take a very long time to disappear).

Clubb was close, but the property is TextTransparency. Check this link.

If you want a fading effect, use a for loop, like so:

for x = 0, 1, 0.05 do
	«GUI».TextTransparency = x
	wait(0.04)
end

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