I currently have a function that should update values inside of a table I’m using to house all inventory data. However, the function doesn’t work at all.
for _,item in pairs(inventory:GetTable(inv)) do
if item.ID == value then
print(item.ID) -- Debugging
print(item.Name) -- Debugging
print("same id!") -- Debugging
item.Equipped = true -- Setting value inside specific item in inventory to true
inventory:Set(inv) -- Supposedly saving changes
print(item.Equipped) -- Returns true...
print(inventory:GetTable(inv)) -- ...Yet not in here?
end
end
Upon printing the table, the .Equipped line is returned as false, as explained in the code. This genuinely makes no sense to me and it’s tiring me out having to find a way to solve this without any proper documentation on DS2’s part.
I’ve also tried using :Save(), using :Set() afterwards, with no results. DS2 is updated to the latest Github version, so that’s not an issue.