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

Simple gui text changing script, why won't it register a change?

local changeText = script.Parent
local waitTime = 0.1

while true do
	changeText.Text = (">CONFIRM")
	wait(waitTime)
	changeText.Text = ("CONFIRM")
	print("Text has recently been run through a change.")
end

It's not registering a change. I'm not sure why even though the script is running and it changes once, after that it doesn't change anymore. What the hell is going on here?

Here's the freemodel w/the Gui so that you can see for yourself: click here to see!

Tell me, what's up w/this?

1 comment

0

How many times does the code print?

1 answer

✓ Accepted answer

This is occuring simply because there is no wait after the second time you change the text. As a result, it instantly starts the loop again, changing it back to the first text, and appearing as if it never changed to the second. To fix this, simply add another wait:

local changeText = script.Parent
local waitTime = 0.1

while true do
    changeText.Text = (">CONFIRM")
    wait(waitTime)
    changeText.Text = ("CONFIRM")
	wait(waitTime)
    print("Text has recently been run through a change.")
end

1 comment

0

Thank you so much. It appears this is the reason!

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