Is there a way to make a script that captures text from a text box, and changes text of text label? Like a script which would captures certian text from a text box, and it would change text of a text label. Any help is greatly appreciated!
Is there a way to make a script that captures text from a text box, and changes text of text label?
1 answer
Is there a way to make a script that captures text from a text box, and changes text of text label?
Well yes, there is a way.
What we'll need to use :
- Values
- Scripts
- TextLabels, TextButtons and TextBoxes
You may be wondering why we'd use a Value for this, well, we're using a Value because it's more easier, better way of storaging the Text and just more efficient overall.
So what we'll do is put a String Value in our TextButton that we'll make, the TextButton will be used as like a 'Submit' button. You don't need to use a TextButton since you can just use the function Entered or something like that later on, but I'm going to do it this way.
So now we have a String Value that can be used for lots of stuff. Your question being one.
We'll also have a TextBox. Now I'm not going to script a TextBox filter for you since I can't just give you script all of the script, you'll have to make your own curse word filter yourself, which isn't too hard to make.
We'll now run the MouseButton1Down function in our TextButton's script.
script.Parent.MouseButton1Down:Connect(function() -- make sure to use a capital C for Connect
-- code
end)
Now we can replicate the TextBoxes text to the TextButton's text.
script.Parent.MouseButton1Down:Connect(function()
script.Parent.StringValue.Value = script.Parent.Parent.TextBox.Text
script.Parent.Parent.TextLabel.Text = script.Parent.Parent.TextButton.StringValue.Value
end)
Hopefully I've helped! Have a good day/night!
If this has helped you, it'd be appreciated if you clicked 'Accept Answer' to let me know that I have helped you, thanks!
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
the title and body of your question are completely unrelated
That confused me, but i didnt care enough to try and figure it out.
I'm really sorry! I just edited the question.
well, both the textbox object and the textlabel object have a text property, you can set the textlabel's text as the textbox's text
we are here to help you with errors in scripts, not make you one.
I am not asking for a script. I am asking for an idea how a script like this should work. I am not requesting code directly. I just have no idea how to do this.