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

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

Asked by 10 years ago

This is what I tried:

1script.Parent.Changed:connect(function(i)
2    if i == 'Text' then
3        script.Parent.Parent.TextLabel.Text(script.Parent[i])
4    end
5end)

1 answer

Log in to vote
2
Answered by 10 years ago

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

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

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

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

Then it might work as well

Ad

Answer this question