Postado Fevereiro 19, 2015 10 anos Tenho uma spell de trap, onde eu fiz algumas modificações. A spell funciona perfeitamente, porém quando alguém usa aparece alguns erros no console e dá um "lag". Segue abaixo minha spell Mostrar conteúdo oculto local action = 12120 -- valor da storage da bomba local mana = 40 -- quantidade de mana para plantar function onCastSpell(cid, var) local waittime = 60 local storage = 34010 if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, 27, "Voce tem que espera " .. exhaustion.get(cid, storage) .. " segundos.") return false end for a = 1, 8 do addEvent(onCastSpell1, a * 100, cid, var) exhaustion.set(cid, storage, waittime) end local pos = getCreaturePosition(cid) local get = getTileInfo(pos).itemid if getCreatureMana(cid) >= mana then if getPlayerItemCount(cid, 2579) >= 1 then doCreatureAddMana(cid, -mana, false) doPlayerRemoveItem(cid, 2579, 1) doPlayerSendTextMessage(cid, 27, "Você armou uma armadilha escondida.") doItemSetAttribute(doCreateItem(get, 1, pos), "aid", action) else doPlayerSendCancel(cid, "Você não tem a armadilha em sua mochila.") end end return true end Agora segue abaixo o erro que aparece no console Mostrar conteúdo oculto [18/02/2015 23:40:34] [Error - Spell Interface] [18/02/2015 23:40:34] data/spells/scripts/Academicos/spell_trap.lua:onCastSpell [18/02/2015 23:40:34] Description: [18/02/2015 23:40:34] (luaAddEvent) Callback parameter should be a function. [18/02/2015 23:40:34] [Error - Spell Interface] [18/02/2015 23:40:34] data/spells/scripts/Academicos/spell_trap.lua:onCastSpell [18/02/2015 23:40:34] Description: [18/02/2015 23:40:34] (luaAddEvent) Callback parameter should be a function. [18/02/2015 23:40:34] [Error - Spell Interface] [18/02/2015 23:40:34] data/spells/scripts/Academicos/spell_trap.lua:onCastSpell [18/02/2015 23:40:34] Description: [18/02/2015 23:40:34] (luaAddEvent) Callback parameter should be a function. [18/02/2015 23:40:35] [Error - Spell Interface] [18/02/2015 23:40:35] data/spells/scripts/Academicos/spell_trap.lua:onCastSpell [18/02/2015 23:40:35] Description: [18/02/2015 23:40:35] (luaAddEvent) Callback parameter should be a function. [18/02/2015 23:40:35] [Error - Spell Interface] [18/02/2015 23:40:35] data/spells/scripts/Academicos/spell_trap.lua:onCastSpell [18/02/2015 23:40:35] Description: [18/02/2015 23:40:35] (luaAddEvent) Callback parameter should be a function. [18/02/2015 23:40:35] [Error - Spell Interface] [18/02/2015 23:40:35] data/spells/scripts/Academicos/spell_trap.lua:onCastSpell [18/02/2015 23:40:35] Description: [18/02/2015 23:40:35] (luaAddEvent) Callback parameter should be a function. [18/02/2015 23:40:35] [Error - Spell Interface] [18/02/2015 23:40:35] data/spells/scripts/Academicos/spell_trap.lua:onCastSpell [18/02/2015 23:40:36] Description: [18/02/2015 23:40:36] (luaAddEvent) Callback parameter should be a function. [18/02/2015 23:40:36] [Error - Spell Interface] [18/02/2015 23:40:36] data/spells/scripts/Academicos/spell_trap.lua:onCastSpell [18/02/2015 23:40:36] Description: [18/02/2015 23:40:36] (luaAddEvent) Callback parameter should be a function. Alguém sabe onde está o erro?
Postado Fevereiro 19, 2015 10 anos Tente usar assim e veja se resolveu local action = 12120 -- valor da storage da bomba local mana = 40 -- quantidade de mana para plantar function onCastSpell(cid, var) local waittime = 60 local storage = 34010 if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, 27, "Voce tem que espera " .. exhaustion.get(cid, storage) .. " segundos.") return false end for a = 1, 8 do addEvent(onCastSpell, a * 100, cid, var) exhaustion.set(cid, storage, waittime) end local pos = getCreaturePosition(cid) local get = getTileInfo(pos).itemid if getCreatureMana(cid) >= mana then if getPlayerItemCount(cid, 2579) >= 1 then doCreatureAddMana(cid, -mana, false) doPlayerRemoveItem(cid, 2579, 1) doPlayerSendTextMessage(cid, 27, "Você armou uma armadilha escondida.") doItemSetAttribute(doCreateItem(get, 1, pos), "aid", action) else doPlayerSendCancel(cid, "Você não tem a armadilha em sua mochila.") end end return true end
Postado Fevereiro 19, 2015 10 anos Autor Em 19/02/2015 em 01:48, roriscrave disse: Tente usar assim e veja se resolveu local action = 12120 -- valor da storage da bomba local mana = 40 -- quantidade de mana para plantar function onCastSpell(cid, var) local waittime = 60 local storage = 34010 if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, 27, "Voce tem que espera " .. exhaustion.get(cid, storage) .. " segundos.") return false end for a = 1, 8 do addEvent(onCastSpell, a * 100, cid, var) exhaustion.set(cid, storage, waittime) end local pos = getCreaturePosition(cid) local get = getTileInfo(pos).itemid if getCreatureMana(cid) >= mana then if getPlayerItemCount(cid, 2579) >= 1 then doCreatureAddMana(cid, -mana, false) doPlayerRemoveItem(cid, 2579, 1) doPlayerSendTextMessage(cid, 27, "Você armou uma armadilha escondida.") doItemSetAttribute(doCreateItem(get, 1, pos), "aid", action) else doPlayerSendCancel(cid, "Você não tem a armadilha em sua mochila.") end end return true end O bug continua :/ Já arrumei aqui, valeu.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.