most likely the problem is this part:
Code:
local inputRaw = splitStringToTable(value,"\n");
for k,v in pairs(inputRaw) do
if not (ShortStats[v]) then -- Check if player entered nonsence. And remove it.
line breaks on windows systems are \r\n, by splitting the list by just \n and not removing the carriage returns, you will not get an exact match against your ShortStats table (other than on the last line which has no line break).
you need to trim each line before you test it:
Code:
v = v:match("^%s*(.-)%s*$") or '';