Felipe Monteiro
Webmaster
I got an erro with traderequest, when I set to with backpacks..
Npc give me only backpack empty !
the "not backpack" part is working fine, only with backpack part is not working.
And sorry by the tag!
Npc give me only backpack empty !
Code:
if items[item].buyPrice <= player:getMoney() then
if inBackpacks then
local container = Game.createItem(1988, 1)
local bp = player:addItemEx(container)
if(bp ~= 1) then
return player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have enough container.')
end
for i = 1, amount do
container:addItem(items[item].itemId, items[item])
end
else
return
player:addItem(items[item].itemId, amount, false, items[item]) and
player:removeMoney(amount * items[item].buyPrice) and
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You bought '..amount..'x '..items[item].realName..' for '..items[item].buyPrice * amount..' gold coins.')
end
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You bought '..amount..'x '..items[item].realName..' for '..items[item].buyPrice * amount..' gold coins.')
player:removeMoney(amount * items[item].buyPrice)
else
player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You do not have enough money.')
end
the "not backpack" part is working fine, only with backpack part is not working.
And sorry by the tag!
Last edited by a moderator: