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

How to take the string from what people type in a textbox?

Asked by 9 years ago

I've seen some people that made models get this wrong. They use Text, not string, or whatever you are supposed to use. So, what am I supposed to do to take the string that people type into textboxes?

1 answer

Log in to vote
0
Answered by
SanityMan 239 Moderation Voter
9 years ago

From a textbox:

local textbox = --put your textbox location here
text = textbox.Text

Allow me to elaborate.

When a player types in a textbox, and then clicks out/stops editing, the Text property of the TextBox updates to what they type. After it does that, you can grab that string by taking the TextBox.Text string. If you want to automatically take the Text when they type it in, try something like this:

local textbox = --once again, put your textbox location here.
textbox.FocusLost:connect(function()
print textbox.Text
end)
0
Dude, if you havent noticed, i said from a textbox :/ groovydino 2 — 9y
0
o SanityMan 239 — 9y
0
Well, can you edit your answer? groovydino 2 — 9y
0
Dude, what people type will not change into the text. So, basically, that script isn't really what I was looking for. groovydino 2 — 9y
View all comments (3 more)
0
The Text value in a textbox IS what people type. When a player finishes editing the textbox, the Text property updates. SanityMan 239 — 9y
0
Dude, trust me. I have tested it in studio. The text is NOT what people type. groovydino 2 — 9y
0
When people type in a TextBox, the Text property changes. It changes *as they're typing*. The Changed event will fire *as they're typing*. It used to work differently, but I just tested it. ZeptixBlade 215 — 9y
Ad

Answer this question