No caso essa bag poderia estar com o jogador?
info
Grupo: Artesão
Registrado: 27/10/12
Posts: 102
Reputação: +12
Char no Tibia: Não tenho

info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif

Nãão!
Tenta assim:
local config = {
posicao = { x = , y = , = z = },
itemId_Box = ,
itemdentrodaBox =
}
function onUse(cid, item, topos, item2, frompos)
local topos_uid = config.posicao
checkItemSlot = getTileItemById(topos_uid, config.itemId_Box)
local checkItemSlot_uid = getContainerItem(checkItemSlot.uid, 0)
if checkItemSlot_uid.itemid == config.itemdentrodaBox then
-- blablablabla
end
end
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

e exatamente como ques checar isso? talk? ![]()
eu gosto dessa function do kydrai..
function getItemsInContainerById(container, itemid) -- Function By Kydrai
local items = {}
if isContainer(container) and getContainerSize(container) > 0 then
for slot=0, (getContainerSize(container)-1) do
local item = getContainerItem(container, slot)
if isContainer(item.uid) then
local itemsbag = getItemsInContainerById(item.uid, itemid)
for i=0, #itemsbag do
table.insert(items, itemsbag)
end
else
if itemid == item.itemid then
table.insert(items, item.uid)
end
end
end
end
return items
end
no caso..
box = 2411
pos = {x= 123, y=321, z=7}
item = 2160
local container = getTileItemById(pos, box)
if container.uid > 0 and isContainer(container.uid) then
local itensInBag = getItemsInContainerById(container.uid, item)
if #itensInBag >= 1 then
tem o item na caixa
else
n tem o item
end
end
Editado Novembro 2 por Slicer





info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif
Olá galera , eu gostaria que voces me indicassem alguma funçao que checa algum item dentro de uma caixa ou bag no chao !
Exemplo :
Eu to com uma caixa no chao no pos (x= 123, y=321, z=7)
e eu quero checar algum item que esteje dentro dessa caixa
ai eu checo tipo assim
box = 2411
pos = {x= 123, y=321, z=7}
item = 2160
if getItemBox(box,pos) == item then
blablablabla
Se alguem nao entendeu , eu explico denovo !!