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

Is there a way to limit the amount of text someone enters?

I am trying to create a gui that someone can enter text into, but I want tho limit the amount of letters they can enter. Is there a way to do this?

4 comments

1

There is, yes.

1 answer

✓ Accepted answer

Cap it

Every time the text changes, just make sure that the text is within a certain length. This can be done withstring.sub

TextBox.Changed:connect(function()
	TextBox.Text = TextBox.Text:sub(1,50);
end);

That would restrain the text length to 50 characters, by making sure that every time anything changes in the TextBox the string has anything past the 50th character cut off. Make sure that you define TextBox.

1 comment

1

Thanks so much! I usually know there is an answer for what I am asking, I'm just too lazy to search the wiki e.e

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