Checking If Textbox Numbers Only

Hey Everyone,

Just a small question

How can i check if the textbox text is numbers and not letters

thanks.

2 Likes
if tonumber(box.Text) then

end

tonumber returns nil if the argument provided to it isn’t a number or a string that represents a number

tonumber(2) == 2
tonumber("500") == 500
tonumber("yes") == nil
tonumber({ }) == nil
5 Likes