Let me explain, if the user inputs "13" the value of amount wont be a number, it will be a string, example:
User inputs "18" Value of "amount": "18" (not a number)
So, instead, you should do this
io.write("enter a number ") amount = io.read() isNumber = tonumber(amount) if not isNumber then print("no amount selected") end
Let me explain, if the user inputs "13" the value of amount wont be a number, it will be a string, example:
User inputs "18" Value of "amount": "18" (not a number)
So, instead, you should do this
by LuaExperimentator, 1 years agoPlease log in to post a comment.