First, the server compiles the data into a string:
Folders: {"lol", "omfg", "test"}
String to send: "lol#omfg#test#"
Client receives: "lol#omfg#test#"
I try to make it into a list using this code here:
function makeArray(str)
s = str
local i = 1
local returnvalue = {}
while string.find(s,"#") do
returnvalue[i] = string.sub(s,string.find(s,"#")-1)
s = string.sub(s,string.find(s,"#")+1)
i = i + 1
end
return returnvalue
end
The result is not
{"lol", "omfg", "test"}
as I expected, but
{"lol","omfg#tes","#"}
instead.
What am I doing wrong here?