You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
The text fading in and out.
-
What is the issue? Include screenshots / videos if possible!
I cant figure out how to do it.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked around everywhere, I just couldnt find anything that would help.
wait(5)
script.Parent.Text = "AstronautJaye presents,"
wait(3.5)
script.Parent.Text = "Pacific Railway"
IT IS A SCRIPT
If you want to make your text transparency increase and decrease just use a while loop.
local TextLabel = script.Parent -- set the variable TextLabel
while TextLabel.TextTransparecy < 1 do -- This is a loop that increase the TextTransparency by 0.1 every 0.1 seconds.
wait(0.1)
TextLabel.TextTransparency += 0.1
end
If you want to fade in make it inverse.
while TextLabel.TextTransparecy > 0 do
wait(0.1)
TextLabel.TextTransparency -= 0.1
end
local timeToTake = 2
local tween = game:GetService("TweenService"):Create(text, TweenInfo.new(timeToTake), {TextTransparency = 0}
tween:Play()
Pretty simple
Change the timeToTake value to change how much time it takes. Currently 2 seconds.
1 Like
Using loops is a bad habit for such things, tween are more efficient.
Yes, you are right.
Is much more easier.
While loops must be used for more complex things.
I should start using TweenService but first I will learn more about how it works.
1 Like
Interesting. Where would I put it in the script
I guess putting it as a local script under the button would be a good idea as handling uis on the client is a good habit.