Hello, I am trying to make a textbox gui where if you type something other than a number then it will remove the non number characters in the text. I have tried tostring() and tonumber() and gsub. How can I do this correctly?
✓ ANSWER ACCEPTED
How would I make a number only text box?
1 answer
✓ Accepted answer
in a runservice heartbeat loop you could do something like TextBox.Text = tonumber(TextBox.Text) or ''
the or '' is to make sure tonumber() doesn't return nil.
This discussion is preserved as it was. New answers, comments, and votes are closed.
