-- 'string:split' from http://lua-users.org/wiki/SplitJoin
function string:split( inSplitPattern, outResults )
if not outResults then
outResults = { }
end
local theStart = 1
local theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
while theSplitStart do
table.insert( outResults, string.sub( self, theStart, theSplitStart-1 ) )
theStart = theSplitEnd + 1
theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
end
table.insert( outResults, string.sub( self, theStart ) )
return outResults
end
-- local description = item:getDescription()
local description = 'Mount: Cavalinho by [ADM] Veteranos'
print(description)
local noMountPart = string.sub(description, 8)
print(noMountPart)
local descriptionParts = noMountPart:split(' by ')
local playerName1 = descriptionParts[1]
local playerName2 = descriptionParts[2]
print('player one:', playerName1)
print('player two:', playerName2)