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

How to print the contents of a TextBox?

Asked by 5 years ago

Alright so.

I need to print the contents of a TextBox for example. The TextBox has the words "wow" in it, this word was typed in by a user. I would like a script that prints whatever the user types in.

0
Please try not to request scripts with no actual attempt here, if you want to do that there are sources especially for that, or you can use the discord. But this is not a request site. turtle2004 167 — 5y

2 answers

Log in to vote
0
Answered by
BenSBk 781 Moderation Voter
5 years ago

Use the TextBox.Text property:

print(textBox.Text)

0
Aha thank you. This seems to have fixed it. A2aZkdL2x_sSaZDFmLoP -2 — 5y
Ad
Log in to vote
0
Answered by
Mr_Unlucky 1085 Moderation Voter
5 years ago

THE GOAL What you want to do is that every time someone types something in a text-box it will print it out. What you want to do is use properties. TextBoxes use the "Text" property which is the current text in the box.

THE CODE

local TextBox = script.Parent --We want to insert the script unde the textbox.
print(TextBox.Text) --We grab the text from the textbox and print it accordingly.

CONCLUSION Properties are extremely useful for GUIs, Tools, Parts, and more. Properties can be manipulated using the period symbol or the "." such as script.Parent.Text. However, there are other ways periods can be used, such as getting children/parents, etc.

Answer this question