View Single Post
06-16-21, 02:00 PM   #7
elcius
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Sep 2011
Posts: 75
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 '';

Last edited by elcius : 06-16-21 at 02:03 PM.
  Reply With Quote