Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago

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)
0
Furthermore, if you wanted it on button press (i.e. enter) you could use User input service turtle2004 167 — 5y
0
Thank you so much! Trooper_Toaster 0 — 5y
Ad

Answer this question