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
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)
tysm
np :)
This is wrong...
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Unless you have higher numbers than 1-2-3-4-5-6-7-8-9-0 that may be something else
yeah, with infinite numbers, good idea -_-