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

Can you use UserInputService for TextBox? [SOLVED]

Asked by 8 years ago

How to detect when a TextBox in a GUI has a specific string of characters?

0
Yes you can, if someone hasn't already answered by the time I'm home i'll guide you towards the right path. Lacryma 548 — 8y
5
Community, do not mark this post as Not Constructive. The claim is weak, and the asker is requesting a yes or no question pertaining to a function of scripting. This question is constructive. M39a9am3R 3210 — 8y
0
Thanks guys :D BinaryResolved 215 — 8y
0
I don't think it's constructive because he doesn't elaborate on his question. It tells you to do so when posting a question. yumtaste 476 — 8y
0
Yes it is because I wasn't actually asking for a answer I was just wondering if it was possible BinaryResolved 215 — 8y

1 answer

Log in to vote
1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
8 years ago

You just need to use an if statement to compare a preset variable - your string of characters - and the TextBox's Text property.

local text = 'StringOfCharacters'
local textboxtext = Gui.TextBox.Text

if text == textboxtext then
    print'detected'
end

Alternatively, you can use the string.gmatch function, provided with any of various string patterns. More info here.

0
*print("detected") fortesss7 40 — 4y
Ad

Answer this question