Posted 21 March 2012 - 10:58 AM
function tag(msg)
local returnTag = {}
local one = 1
repeat
local firstletter = string.find(msg, "[", one)
local lastletter = string.find(msg, "]", one)
one = lastletter
returnTag[#returnTag+1] = string.sub(msg, firstletter, lastletter)
msg = string.sub(msg, lastletter+1, string.len(msg))
until not string.find(msg, "[", one)
return unpack(returnTag)
end
It complains about line 5 with the "["
Why is this happening?
And how can I fix it.