Cara não coloca Principal... é ele que ta dando o bug, testa assim:
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
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 15000, 0, 20000)
function onCastSpell(cid, var)
local YellowBag = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, 1992) --verifica se tem a yellow bag dentro da bag
if #YellowBag >= 1 then
for i = 1, #YellowBag do --coloque o id aki!
local Item = getItemsInContainerById(YellowBag, 1992) --verifica se tem o item dentro de alguma yellow bag...
if #Item >= 1 then
return doCombat(cid, combat, var)
end
end
end
return FALSE
end



info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2
function onCastSpell(cid, var) local YellowBag = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, 1992) --verifica se tem a yellow bag dentro da bag principal... if #YellowBag >= 1 then for i = 1, #YellowBag do 5952bump