Lua:
local teste = Action()
function teste.onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.itemid == 9957 then
local torch_storage, torch_monsters = Event_Lightbearer.getTorchInfo(toPosition)
if not (getPlayerStorageValue(cid, torch_storage) == 1) then
for _, monsterName in ipairs(Lightbearer_Configurations.Torchs[getItemAttribute(itemEx.uid, 9957)].monsters) do
doCreateMonster(monsterName, getThingPos(cid))
end
doRemoveItem(itemEx.uid)
addEvent(Event_Lightbearer.spawnMonster, 60 * 1000, getThingPos(cid), cid, torch_monsters)
else
doPlayerSendCancel(cid, "Voce ja acendeu esta tocha, procure outras.")
end
end
return true
end
teste:id(9956)
teste:register()
Lua:
Lua Script Error: [Scripts Interface]
magical_torch.lua:callback
magical_torch.lua:15: attempt to call global 'getItemAttribute' (a nil value)
stack traceback:
[C]: in function 'getItemAttribute'
magical_torch.lua:15: in function <...ata/scripts/eventos_global/Lightbearer/magical_torch.lua:4>
when you use the item you would have to summon the mob but it is returning this error
LIB
Lua:
Torchs = {
{pos = {x = 33015, y = 32383, z = 1}, monsters = {"rat"}, storage= 23097},
},
Last edited: