Add this to the beginning of your script and it should work (unless you're using someone's encrypted xblua, then you need to contact the creator):
lua code:
local saleCountWithEq = Self.ShopGetItemSaleCount
function Self.ShopGetItemSaleCount(item)
local id = Item.GetItemIDFromDualInput(item)
local function countInEquipment()
local count = 0
local slots = {Self.Head, Self.Armor, Self.Legs, Self.Feet, Self.Amulet, Self.Weapon, Self.Ring, Self.Shield, Self.Ammo}
for _, slot in ipairs(slots) do
local item = slot()
if item.id == id then
count = count + math.max(item.count, 1)
end
end
return count
end
return saleCountWithEq(id) - countInEquipment()
end