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

How Can I get a Textbox's Text to display on a TextLabel?

Im trying to make a script that the textlabel will change to what ever is in the TextBox

I have a button which I want to change the text on click. It is in a local script

Do you have any ideas?

1 answer

✓ Accepted answer

If you want your TextLabel to display the text of your TextBox once a button is clicked, simply connect MouseButton1Click to the button, and then set the TextLabel's Text property to the TextBox's Text, like this:

button.MouseButton1Click:Connect(function()
	label.Text = box.Text
end)

If you want it to change as you type in the TextBox, connect to GetPropertyChangedSignal("Text") of the TextBox

box:GetPropertyChangedSignal("Text"):Connect(function()
	label.Text = box.Text
end)

2 comments

0

Furthermore, if you wanted it on button press (i.e. enter) you could use User input service

0

Thank you so much!

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