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 9 years ago

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

Log in to vote
2
Answered by 9 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

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

Ad

Answer this question