How to keep a text box's characters, to just 1, 2, 3, and 4? (Solved)
Asked by
5 years ago Edited 5 years ago
So, in my game, this is for the lobby. When they make a lobby, they can make it 1 - 4 players. But text boxes can have letters, numbers, and lots of them. Is there a way to make it only be able to have 1 - 4, just once. So not 11 22 33, etc... I found some code, but it doesn't work.
1 | local TextBox = script.Parent |
2 | TextBox:GetPropertyChangedSignal( "Text" ):Connect( function () |
3 | if tonumber (TextBox.Text) then |
4 | script.Parent.Number.Value = script.Parent.Text |