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

I'm trying to put a TextBox's input into a TextLabel. Help? [UNANSWERED]

This is what I tried:

script.Parent.Changed:connect(function(i)
	if i == 'Text' then
		script.Parent.Parent.TextLabel.Text(script.Parent[i])
	end
end)

1 answer

✓ Accepted answer

Can you elaborate? If you are trying to automatically update it whenever the text is changed that won't work. If what you want to do is update whenever they get out of the textbox you could do

script.Parent.FocusLost:connect(function(enterPressed)
	--This is called whenever you stop editing the text in a TextBox, either by pressing enter or clicking outside the box
	--As an option you can check if the enter key was pressed when focus was lost

	script.Parent.Parent.TextLabel.Text = script.Parent.Text
end)

Also since I didn't personally test the script I'm not 100% sure but I believe if you change line 3 to

script.Parent.Parent.TextLabel.Text = script.Parent.Text

Then it might work as well

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