Won't this crash if someone enters a string like 'hello'?
Maybe try some regex magic like:
>local input = read()
>  if input:match('[0-9]*') ~= input then
>    --they didn't put in a number
>  end