Some things returned by getchar are not integers, apparently (e.g. <Left> and mouse clicks return a string rather than a single keycode). As such, string.char does not work on them, and it throws an error when you try to use it how it was being used before.
To fix it, I moved the string.char conversion into the pcall that already existed for getchar.
Some things returned by
getchar
are notinteger
s, apparently (e.g.<Left>
and mouse clicks return a string rather than a single keycode). As such,string.char
does not work on them, and it throws an error when you try to use it how it was being used before.To fix it, I moved the
string.char
conversion into thepcall
that already existed forgetchar
.