xxxxxxxxxx
xxxxxxxxxx
Last edited by Elizabeth; 04-01-2022 at 06:12 AM.
It's actually Tibia that does this. Right click on the trade window and you'll be able to change the setting that prevents you from selling your equipment.
Imo the real problem is that Self.ShopGetItemSaleCount() reports your equipment as sellable regardless of your trading settings. Because of this people get stuck in infinite loops whenever they try to sell something that they are also wearing. This can be worked around in lua, but almost no scripts do it.
If you do want to sell your equipment you just need to change your trade settings. If you don't want to get stuck in a loop you need a better script.
I'm at work atm, but I've posted it on the forums on several occasions before.
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