Hello,
Im bit stuck with something. I want to convert string to table, since attributes does not accept tables and i suck on using prefixs.
So i would like to split name/level as key entry and value entry. So will be able to loop like this:
Cheers.
Im bit stuck with something. I want to convert string to table, since attributes does not accept tables and i suck on using prefixs.
Code:
target:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, ("{name = %s}, {level = %d}"):format(player:getName(), player:getLevel()))
Code:
local t = {}
target:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION):gsub("{(.-)}", function(a) t[#t+ 1] = a end)
So i would like to split name/level as key entry and value entry. So will be able to loop like this:
Code:
for _, v in ipairs(t) do
print(v.name, value.level)
end
Cheers.
Last edited: