Gladox114 1 Posted March 23, 2018 Share Posted March 23, 2018 I know that "not nil" is wrong but how to test if the input is a nummber and do something when input is a nummber. read = io.read() if string.match(read, "(%d+)") == not nil then -- do something end Quote Link to post Share on other sites
0 Molinko 43 Posted March 23, 2018 Share Posted March 23, 2018 local input = io.read() if not tonumber(input) then -- input is not a number end Quote Link to post Share on other sites
I know that "not nil" is wrong but how to test if the input is a nummber and do something when input is a nummber.
Link to post
Share on other sites