BE
pedido

Spell Get Item Id Em Bag

Por Bennyhappy, 26 de nov. de 2012 em Scripts

20
3.1k
BennyhappyB
03 de dezembro de 2012 às 00:50

[01/12/2012 18:02:51] [Error - LuaScriptInterface::loadFile] data/spells/scripts/healing/spell scroll heal.lua:32: '=' expected near '...'
[01/12/2012 18:02:51] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/healing/spell scroll heal.lua)
[01/12/2012 18:02:51] data/spells/scripts/healing/spell scroll heal.lua:32: '=' expected near '...'

 

 

       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 5952 

 

 

:/

 

bump

Yan OliveiraY
03 de dezembro de 2012 às 17:52

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

 

 

BennyhappyB
04 de dezembro de 2012 às 03:44

nao abre spoiler bro

Yan OliveiraY
06 de dezembro de 2012 às 22:14

Abre sim, espere sua pagina carregar toda primeiro.

BennyhappyB
08 de dezembro de 2012 às 17:12

nao esta completo o script xD!