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

Why doesn't the text change in the GUI?

I am having some problems with this. Can someone help me?

Text = script.Parent.Text



while wait() do
	print"Loaded"
	wait(5)
	Text = "News; Major updates to how the holo runs and looks."
	wait(7)
	Text = "Please listen to your trainer. Remember, HRs no AAing"
	wait(7)
	Text = "Wear the group uniform at all times. Buy the sub if you cannot afford it"
	wait(7)
	Text = "Nothing can be done without team work. Remember that"
	wait(2)
	print"Finished"
end

1 answer

✓ Accepted answer

When you set the Text variable, you're essentially storing a copy of what the text was at the time the script ran. You basically did this.

Text = "TextLabel"

while wait() do
    print"Loaded"
    wait(5)
    Text = "News; Major updates to how the holo runs and looks."
    wait(7)
    Text = "Please listen to your trainer. Remember, HRs no AAing"
    wait(7)
    Text = "Wear the group uniform at all times. Buy the sub if you cannot afford it"
    wait(7)
    Text = "Nothing can be done without team work. Remember that"
    wait(2)
    print"Finished"
end

You're changing the value of the variable now, but it's not actually changing the text. You do in fact have to type .Text to change the Text property of a GUI. However, you could still have a variable for the GUI itself.

label = script.Parent

while wait() do
    print"Loaded"
    wait(5)
    label.Text = "News; Major updates to how the holo runs and looks."
    wait(7)
    label.Text = "Please listen to your trainer. Remember, HRs no AAing"
    wait(7)
    label.Text = "Wear the group uniform at all times. Buy the sub if you cannot afford it"
    wait(7)
    label.Text = "Nothing can be done without team work. Remember that"
    wait(2)
    print"Finished"
end

1 comment

0

Thank you!

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