The only way I can think of how to do this is with a little bit of string manipulation. If you look the string GetAsync is returning, you'll notice that each asset is separated by a semi-colon [ ; ]. Using this, we can use some loops to find out how many assets there are (the last one does not have a semi-colon, so we'll need to add one) and then extract the asset ids from the string.
local http = game:GetService('HttpService')
local data = http:GetAsync('http://www.roproxy.tk/Asset/AvatarAccoutrements.ashx?userId=156')
function createTable()
local array = {}
local assetSeparators = {}
for value in string.gmatch(data, ";") do
table.insert(assetSeparators, value)
end
local lastEnd = 1
for i = 1, #assetSeparators do
table.insert(array, string.sub(data, lastEnd, string.find(data, ";", lastEnd) - 1))
lastEnd = string.find(data, ";", lastEnd + 1) + 1
end
table.insert(array, string.sub(data, lastEnd))
return array
end
local array = createTable()
1 comment
Wow, never knew about complement patterns. This is much better than my overcomplicated one.