so i wanna detect if the text on a TextBox is a number. how could i do that?
Edit: Nvm, i had to use tonumber
do something like
if script.parent.Text = "1", "2"
String="124124" if tostring(tonumber(String)) == "" then print'not Number' else print'Is number' end
That is how to detect if it HAS numbers
EDIT:
That was a joke.
here is how to make the textbox only contain numbers
textBox.Changed:connect(function(p) if p=="text" then textBox.Text = tonumber(textBox.Text) end end)
Marked as Duplicate by cabbler and evaera
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?