Postado Agosto 26, 2024 Ago 26 Qual o motivo deste tópico? spell de buff dando erro na distro Está surgindo algum erro? Se sim coloque-o aqui. [25/08/2024 21:14:12] [Error - Spell Interface] [25/08/2024 21:14:12] In a timer event called from: [25/08/2024 21:14:12] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:14:12] Description: [25/08/2024 21:14:12] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:14:12] [Error - Spell Interface] [25/08/2024 21:14:12] In a timer event called from: [25/08/2024 21:14:12] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:14:12] Description: [25/08/2024 21:14:12] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:14:42] [Error - Spell Interface] [25/08/2024 21:14:42] In a timer event called from: [25/08/2024 21:14:42] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:14:42] Description: [25/08/2024 21:14:42] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:15:22] [Error - Spell Interface] [25/08/2024 21:15:22] In a timer event called from: [25/08/2024 21:15:22] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:15:22] Description: [25/08/2024 21:15:22] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:16:12] [Error - Spell Interface] [25/08/2024 21:16:12] In a timer event called from: [25/08/2024 21:16:12] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:16:12] Description: [25/08/2024 21:16:12] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:17:12] [Error - Spell Interface] [25/08/2024 21:17:12] In a timer event called from: [25/08/2024 21:17:12] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:17:12] Description: [25/08/2024 21:17:12] (luaDoCreatureSetStorage) Creature not found Citar Você tem o código disponível? Se tiver publique-o aqui: function onCastSpell(cid, var) local storage = 55512 -- Storage para controlar a spell local stage = getPlayerStorageValue(cid, storage) or 0 -- Obtém o estágio atual da spell, se não houver nenhum, assume 0 local waittimes = {30, 30, 40, 50, 60} -- Tempos de espera para cada estágio em segundos local storage2 = 55513 local waittime3 = 310 if exhaustion.check(cid, storage2) then doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage2) .. " segundos para usar a spell novamente.") return false end if not isCreature(cid) then return false end if stage > 0 then doPlayerSendCancel(cid, "Você já está sob o efeito da spell.") return false end -- Definir o estágio inicial da spell setPlayerStorageValue(cid, storage, 1) stage = 1 -- Função para avançar para o próximo estágio após o término do atual local function advanceStage() if stage < #waittimes then stage = stage + 1 setPlayerStorageValue(cid, storage, stage) -- Programar o próximo avanço de estágio addEvent(advanceStage, waittimes[stage] * 1000) else -- Resetar a storage quando todos os estágios terminarem setPlayerStorageValue(cid, storage, -1) end end -- Iniciar o avanço de estágio addEvent(advanceStage, waittimes[stage] * 1000) -- Definir a exhaustion e aplicar os efeitos iniciais da spell local waittime = waittimes[1] -- Definir o tempo de exhaustion baseado no primeiro estágio exhaustion.set(cid, storage2, waittime3) OpenGate(cid, Select_Stages(getCreatureOutfit(cid).lookType), 1) -- Definir a storage de volta para -1 após o término do efeito da spell addEvent(function() setPlayerStorageValue(cid, storage, -1) end, waittime * 1000) -- Convertendo segundos para milissegundos return true end o erro começou depois que eu coloquei uma função no creaturescript para deixar todos os player com essa storage 55512, quando relogasse para -1. a spell não da nenhum erro na distro se o player ficar logado e completar ela inteira, mas quando o player desloga da esses erros na distro, mesmo se o player tiver deslogado continua dando o erro na distro... alguem da uma força por favor, deixei o outro topico em que me ajudaram a acertar a spell certinho porem começou a dar este erro agora... Editado Agosto 26, 2024 Ago 26 por Gabrielxxxxx (veja o histórico de edições)
Postado Agosto 28, 2024 Ago 28 Boa noite @Gabrielxxxxx, essa função advanceStage é chamada algumas vezes num intervalo de tempo e ela tenta setar a storage no player, se ele estiver deslogado vai dar esse erro, pois o servidor não encontra o player. É só adicionar um check nela, assim: -- Função para avançar para o próximo estágio após o término do atual local function advanceStage() -- checa se o player/creature existe if not isCreature(cid) then return false end if stage < #waittimes then stage = stage + 1 setPlayerStorageValue(cid, storage, stage) -- Programar o próximo avanço de estágio addEvent(advanceStage, waittimes[stage] * 1000) else -- Resetar a storage quando todos os estágios terminarem setPlayerStorageValue(cid, storage, -1) end end Ajudei? De nada \o/ Att Rusherzin
Postado Agosto 29, 2024 Ago 29 Em 25/08/2024 em 21:41, Gabrielxxxxx disse: Qual o motivo deste tópico? spell de buff dando erro na distro Está surgindo algum erro? Se sim coloque-o aqui. [25/08/2024 21:14:12] [Error - Spell Interface] [25/08/2024 21:14:12] In a timer event called from: [25/08/2024 21:14:12] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:14:12] Description: [25/08/2024 21:14:12] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:14:12] [Error - Spell Interface] [25/08/2024 21:14:12] In a timer event called from: [25/08/2024 21:14:12] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:14:12] Description: [25/08/2024 21:14:12] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:14:42] [Error - Spell Interface] [25/08/2024 21:14:42] In a timer event called from: [25/08/2024 21:14:42] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:14:42] Description: [25/08/2024 21:14:42] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:15:22] [Error - Spell Interface] [25/08/2024 21:15:22] In a timer event called from: [25/08/2024 21:15:22] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:15:22] Description: [25/08/2024 21:15:22] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:16:12] [Error - Spell Interface] [25/08/2024 21:16:12] In a timer event called from: [25/08/2024 21:16:12] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:16:12] Description: [25/08/2024 21:16:12] (luaDoCreatureSetStorage) Creature not found [25/08/2024 21:17:12] [Error - Spell Interface] [25/08/2024 21:17:12] In a timer event called from: [25/08/2024 21:17:12] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [25/08/2024 21:17:12] Description: [25/08/2024 21:17:12] (luaDoCreatureSetStorage) Creature not found Você tem o código disponível? Se tiver publique-o aqui: function onCastSpell(cid, var) local storage = 55512 -- Storage para controlar a spell local stage = getPlayerStorageValue(cid, storage) or 0 -- Obtém o estágio atual da spell, se não houver nenhum, assume 0 local waittimes = {30, 30, 40, 50, 60} -- Tempos de espera para cada estágio em segundos local storage2 = 55513 local waittime3 = 310 if exhaustion.check(cid, storage2) then doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage2) .. " segundos para usar a spell novamente.") return false end if not isCreature(cid) then return false end if stage > 0 then doPlayerSendCancel(cid, "Você já está sob o efeito da spell.") return false end -- Definir o estágio inicial da spell setPlayerStorageValue(cid, storage, 1) stage = 1 -- Função para avançar para o próximo estágio após o término do atual local function advanceStage() if stage < #waittimes then stage = stage + 1 setPlayerStorageValue(cid, storage, stage) -- Programar o próximo avanço de estágio addEvent(advanceStage, waittimes[stage] * 1000) else -- Resetar a storage quando todos os estágios terminarem setPlayerStorageValue(cid, storage, -1) end end -- Iniciar o avanço de estágio addEvent(advanceStage, waittimes[stage] * 1000) -- Definir a exhaustion e aplicar os efeitos iniciais da spell local waittime = waittimes[1] -- Definir o tempo de exhaustion baseado no primeiro estágio exhaustion.set(cid, storage2, waittime3) OpenGate(cid, Select_Stages(getCreatureOutfit(cid).lookType), 1) -- Definir a storage de volta para -1 após o término do efeito da spell addEvent(function() setPlayerStorageValue(cid, storage, -1) end, waittime * 1000) -- Convertendo segundos para milissegundos return true end o erro começou depois que eu coloquei uma função no creaturescript para deixar todos os player com essa storage 55512, quando relogasse para -1. a spell não da nenhum erro na distro se o player ficar logado e completar ela inteira, mas quando o player desloga da esses erros na distro, mesmo se o player tiver deslogado continua dando o erro na distro... alguem da uma força por favor, deixei o outro topico em que me ajudaram a acertar a spell certinho porem começou a dar este erro agora... O que o rapaz acima falou pode ser usado também. mas, teste assim também: function onCastSpell(cid, var) local storage = 55512 local storage2 = 55513 -- Exhaust local waittimes = {30, 30, 40, 50, 60} local waittime3 = 310 if not isCreature(cid) or exhaustion.check(cid, storage2) then doPlayerSendCancel(cid, "Aguarde " .. (exhaustion.get(cid, storage2) or 0) .. " segundos para usar a spell novamente.") return false end if getPlayerStorageValue(cid, storage) > 0 then doPlayerSendCancel(cid, "Você já está sob o efeito da spell.") return false end setPlayerStorageValue(cid, storage, 1) exhaustion.set(cid, storage2, waittime3) OpenGate(cid, Select_Stages(getCreatureOutfit(cid).lookType), 1) local function advanceStage() if not isCreature(cid) then return false end local stage = getPlayerStorageValue(cid, storage) if stage < #waittimes then stage = stage + 1 setPlayerStorageValue(cid, storage, stage) addEvent(advanceStage, waittimes[stage] * 1000) else setPlayerStorageValue(cid, storage, -1) -- Reseta a storage ao final dos estágios end end addEvent(advanceStage, waittimes[1] * 1000) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, storage, -1) end end, waittimes[1] * 1000) return true end aka aka
Postado Agosto 31, 2024 Ago 31 Autor Em 28/08/2024 em 20:24, Rusherzin disse: Boa noite @Gabrielxxxxx, essa função advanceStage é chamada algumas vezes num intervalo de tempo e ela tenta setar a storage no player, se ele estiver deslogado vai dar esse erro, pois o servidor não encontra o player. É só adicionar um check nela, assim: -- Função para avançar para o próximo estágio após o término do atual local function advanceStage() -- checa se o player/creature existe if not isCreature(cid) then return false end if stage < #waittimes then stage = stage + 1 setPlayerStorageValue(cid, storage, stage) -- Programar o próximo avanço de estágio addEvent(advanceStage, waittimes[stage] * 1000) else -- Resetar a storage quando todos os estágios terminarem setPlayerStorageValue(cid, storage, -1) end end deu esse erro na distro quando o player ta deslogado [31/08/2024 14:01:56] [Error - Spell Interface] [31/08/2024 14:01:56] In a timer event called from: [31/08/2024 14:01:56] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [31/08/2024 14:01:56] Description: [31/08/2024 14:01:56] (luaDoCreatureSetStorage) Creature not found Em 29/08/2024 em 01:39, Nolangg disse: O que o rapaz acima falou pode ser usado também. mas, teste assim também: function onCastSpell(cid, var) local storage = 55512 local storage2 = 55513 -- Exhaust local waittimes = {30, 30, 40, 50, 60} local waittime3 = 310 if not isCreature(cid) or exhaustion.check(cid, storage2) then doPlayerSendCancel(cid, "Aguarde " .. (exhaustion.get(cid, storage2) or 0) .. " segundos para usar a spell novamente.") return false end if getPlayerStorageValue(cid, storage) > 0 then doPlayerSendCancel(cid, "Você já está sob o efeito da spell.") return false end setPlayerStorageValue(cid, storage, 1) exhaustion.set(cid, storage2, waittime3) OpenGate(cid, Select_Stages(getCreatureOutfit(cid).lookType), 1) local function advanceStage() if not isCreature(cid) then return false end local stage = getPlayerStorageValue(cid, storage) if stage < #waittimes then stage = stage + 1 setPlayerStorageValue(cid, storage, stage) addEvent(advanceStage, waittimes[stage] * 1000) else setPlayerStorageValue(cid, storage, -1) -- Reseta a storage ao final dos estágios end end addEvent(advanceStage, waittimes[1] * 1000) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, storage, -1) end end, waittimes[1] * 1000) return true end o unico erro que deu na distro foi enquanto o player estava no meio da spell [31/08/2024 14:07:08] [Error - Spell Interface] [31/08/2024 14:07:08] In a timer event called from: [31/08/2024 14:07:08] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [31/08/2024 14:07:08] Description: [31/08/2024 14:07:08] data/spells/scripts/maito gai/hachimon_tonkou.lua:212: attempt to perform arithmetic on field '?' (a nil value) [31/08/2024 14:07:08] stack traceback: [31/08/2024 14:07:08] data/spells/scripts/maito gai/hachimon_tonkou.lua:212: in function <data/spells/scripts/maito gai/hachimon_tonkou.lua:203> Editado Agosto 31, 2024 Ago 31 por Gabrielxxxxx (veja o histórico de edições)
Postado Setembro 1, 2024 Set 1 Agora, Gabrielxxxxx disse: deu esse erro na distro quando o player ta deslogado [31/08/2024 14:01:56] [Error - Spell Interface] [31/08/2024 14:01:56] In a timer event called from: [31/08/2024 14:01:56] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [31/08/2024 14:01:56] Description: [31/08/2024 14:01:56] (luaDoCreatureSetStorage) Creature not found o unico erro que deu na distro foi enquanto o player estava no meio da spell [31/08/2024 14:07:08] [Error - Spell Interface] [31/08/2024 14:07:08] In a timer event called from: [31/08/2024 14:07:08] data/spells/scripts/maito gai/hachimon_tonkou.lua:onCastSpell [31/08/2024 14:07:08] Description: [31/08/2024 14:07:08] data/spells/scripts/maito gai/hachimon_tonkou.lua:212: attempt to perform arithmetic on field '?' (a nil value) [31/08/2024 14:07:08] stack traceback: [31/08/2024 14:07:08] data/spells/scripts/maito gai/hachimon_tonkou.lua:212: in function <data/spells/scripts/maito gai/hachimon_tonkou.lua:203> tenta assim agora: function onCastSpell(cid, var) local storage = 55512 local storage2 = 55513 -- Exhaust local waittimes = {30, 30, 40, 50, 60} local waittime3 = 310 if not isCreature(cid) or exhaustion.check(cid, storage2) then doPlayerSendCancel(cid, "Aguarde " .. (exhaustion.get(cid, storage2) or 0) .. " segundos para usar a spell novamente.") return false end if getPlayerStorageValue(cid, storage) > 0 then doPlayerSendCancel(cid, "Você já está sob o efeito da spell.") return false end setPlayerStorageValue(cid, storage, 1) exhaustion.set(cid, storage2, waittime3) OpenGate(cid, Select_Stages(getCreatureOutfit(cid).lookType), 1) local function advanceStage() if not isCreature(cid) then return false end local stage = getPlayerStorageValue(cid, storage) if stage and stage < #waittimes then stage = stage + 1 setPlayerStorageValue(cid, storage, stage) addEvent(advanceStage, waittimes[stage] * 1000) else setPlayerStorageValue(cid, storage, -1) -- Reseta a storage ao final dos estágios end end addEvent(advanceStage, waittimes[1] * 1000) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, storage, -1) end end, (waittimes[#waittimes] + waittimes[1]) * 1000) return true end caso apareça algum erro retorne aqui. aka aka
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.