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

My Textbutton GUI isn't changing text or transparency?

Asked by 5 years ago
Edited by User#24403 5 years ago

Hey everyone, I'm trying to make the text in my textbutton gui change transparency and change the message, but the script I wrote isn't working at all. I have no idea what is going wrong and it seems like it should work, but it isn't... any reason why? Script:

local textbox = script.Parent

wait(5)

for i = 1,10 do 
    wait(0.1)
    textbox.TextTransparency = textbox.TextTransparency + 0.1
end
textbox.Text = "(new text)"
for i = 1,10 do
    wait(0.1)
    textbox.TextTransparency = textbox.TextTransparency - 0.1
end
wait(5)
0
Also, under starter GUI, the hierarchy is ScreenGUI > TextBox > LocalScript thinknoodlesmine 9 — 5y
0
I put the code in a codeblock. It is expect that you do this yourself next time https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site User#24403 69 — 5y
0
Why do you have arbitrary wait calls at line 3 and 14? User#24403 69 — 5y
0
So the user has time to read the text on the screen before it changes thinknoodlesmine 9 — 5y
0
This code annoys me so much. I normally use for i = 1,10,1 do also, i subtract the transparency by .01 for a smoother transition... greatneil80 2647 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

reads a few lines and finds the error. TextTransparency isn't a valid property of Text UI Objects. remove the word text and your issue is solved.

local textbox = script.Parent

wait(5)

for i = 1, 10 do 
    wait(0.1)
    textbox.Transparency = textbox.Transparency + 0.1
end
textbox.Text = "(new text)"
for i = 1, 10 do
    wait(0.1)
    textbox.Transparency = textbox.Transparency - 0.1
end

wait(5)

Unless, your trying to connect to another text child inside explorer, this should work.

Ad

Answer this question