Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

7 comments

0

Dude, if you havent noticed, i said from a textbox :/

0

o

0

Well, can you edit your answer?

0

Dude, what people type will not change into the text. So, basically, that script isn't really what I was looking for.

0

The Text value in a textbox IS what people type. When a player finishes editing the textbox, the Text property updates.

0

Dude, trust me. I have tested it in studio. The text is NOT what people type.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.