Seems like the script's problem
change line 49
local x = sqlite_column_data(q,0), y = sqlite_column_data(q,1), z = sqlite_column_data(q,2), Creatorname = sqlite_column_data(q,3);
to
local x = sqlite_column_data(data,0), y = sqlite_column_data(data,1), z = sqlite_column_data(data,2), Creatorname = sqlite_column_data(data,3);