Is it possible to detect if the first 'letter' somebody said was a letter or something else like a 9 or a :?
Yes, you can use the string.sub
function to slice strings in order to compare parts of them.
msg = ":m hello" if msg:sub(1, 1) == ":" then print(msg:sub(2)) --^ prints "m hello" end
function is_letter(s) if not s:match("[^%a]") then return true end end print(is_letter(msg:sub(1, 1)) and "It's a letter" or "Not a letter!") --> Not a letter! print(is_letter("a") and "It's a letter!" or "Not a letter!") --> It's a letter!