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

Why won't a TextBox Text edit with a Script?

I am making a ROBLOX Game, and when I type this word out exactly, the text will not change.

if script.Parent.Text == "Where am I?" then script.Parent.Text = "You are in ROBLOX"
	wait(1)
end

1 answer

You need to place your code in an event handler for the Changed event of the TextBox:

In a Localscript that is a child to the TextBox:

local textbox = script.Parent
textbox.Changed:connect(function(property)
	if property == "Text" and textbox.Text == "Where am I?" then
		textbox.Text = "You are in ROBLOX"
	end
end)

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