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

Can you use UserInputService for TextBox? [SOLVED]

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

5 comments

0

Yes you can, if someone hasn't already answered by the time I'm home i'll guide you towards the right path.

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.

0

Thanks guys :D

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.

0

Yes it is because I wasn't actually asking for a answer I was just wondering if it was possible

1 answer

✓ Accepted answer

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.

1 comment

0

*print("detected")

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