How would I make this script make it so the text box can only have 1 number (Sudoku Game)?
Asked by
5 years ago Edited 5 years ago
Basically, there is a parent to this local script, which is a text box.
I'm trying to make it so that it only shows numbers, but can only have one number in it.
This script makes it so there are only numbers, but users can put more than one number, which I don't want.
1 | function NumberValidation () |
2 | if tonumber (script.Parent.Text) ~ = nil then |
4 | else script.Parent.Text = "" |
8 | script.Parent:GetPropertyChangedSignal( "Text" ):Connect(NumberValidation) |