4,951
edits
Falterfire (talk | contribs) (Added a check to allow for retrieving items with # in the name) |
Falterfire (talk | contribs) (Fixed typo with last edit) |
||
Line 79: | Line 79: | ||
for i, item in pairs(ItemData.Items) do | for i, item in pairs(ItemData.Items) do | ||
local itemName = string.gsub(item.name, '#', '') | local itemName = string.gsub(item.name, '#', '') | ||
if( | if(name == itemName) then | ||
result = Shared.clone(item) | result = Shared.clone(item) | ||
--Make sure every item has an id, and account for Lua being 1-index | --Make sure every item has an id, and account for Lua being 1-index | ||
Line 735: | Line 735: | ||
end | end | ||
if addCategories then result = result..table.concat(categoryArray, '') end | if addCategories then result = result..table.concat(categoryArray, '') end | ||
return | return resultf | ||
end | end | ||