Postado Janeiro 2, 2015 10 anos o erro acontece pq vc é um callback onKill que está registrado no login.lua pra todos os players, troca por um onDeath ou um onStatsChange que resolve (só faz as modificações necesárias e coloca no xml do monstro em vez de colocar no login.lua
Postado Janeiro 2, 2015 10 anos Solução Em 02/01/2015 em 22:08, xWhiteWolf disse: troca por um onDeath Você está certo, é mais simples e correto assim ;] @Thiago Virtuoso local generator = { ["Castle Generator I"] = {brother = "Castle Generator II"}, ["Castle Generator II"] = {brother = "Castle Generator I"} } local generatorArea = { fromPos = {x = 1130, y = 1751, z = 7}, toPos = {x = 1134, y = 1813, z = 7} } local pos = { {x= 1050, y= 1813, z= 7}, {x= 1050, y= 1812, z= 7}, {x= 1050, y= 1811, z= 7}, {x= 1050, y= 1810, z= 7}, {x= 1050, y= 1809, z= 7}, {x= 1047, y= 1809, z= 7}, {x= 1048, y= 1809, z= 7}, {x= 1047, y= 1809, z= 7}, {x= 1050, y= 1752, z= 7}, {x= 1050, y= 1753, z= 7}, {x= 1050, y= 1754, z= 7}, {x= 1050, y= 1755, z= 7}, {x= 1047, y= 1755, z= 7}, {x= 1048, y= 1755, z= 7}, {x= 1049, y= 1755, z= 7}, {x= 1050, y= 1755, z= 7} } function onDeath(cid) if generator[getCreatureName(cid)] then firstm = generator[getCreatureName(cid)] secondm = getCreatureByName(firstm.brother) if isMonster(secondm) then if isInRange(getCreaturePosition(secondm), generatorArea.fromPos, generatorArea.toPos) then return true end else items = {9533, 9485} -- items list to remove for p = 1, #pos do for i = 1, #items do item = getTileItemById(pos[p], items[i]) if item.uid > 0 then doRemoveItem(item.uid) end end end doBroadcastMessage('Os geradores primários foram destruídos, acesso aos geradores reservas liberado!') end end return true end Altere a tag do creature event para death e adicione a seguinte tag ao(s) arquivo(s) XML do(s) monster(s) que for(em) executar esse script ao morrer(em) (o(s) monster(s) configurado(s) na tabela), com o nome estipulado ao creature event na tag (creaturescripts.xml) do mesmo: <script> <event name="EventName"/> </script>
Postado Janeiro 2, 2015 10 anos Autor muito obrigado Suicide e xWhiteWolf funcionou certinho agora vlw
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.