Ir para conteúdo

Como Arruma Esse Bug?


Strubol

Posts Recomendados

Bom pessoal, eu estou criando um ot, e nesse ot eu to colocando um zombie event

Vou passar as dúvidas:

1ª:Está dando um bug que quando o evento acaba os zumbis não somem, continuam na arena.Eu não sei se esse bug no meu ot faz isso acontecer,

[02/09/2011 17:47:23] > Broadcasted message: "Zombie arena event finished! No one win?!?!?! WTF!".

[02/09/2011 17:47:23] [Error - CreatureScript Interface] 
[02/09/2011 17:47:23] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[02/09/2011 17:47:23] Description: 
[02/09/2011 17:47:23] data/creaturescripts/scripts/zombie/onattack.lua:25: bad argument #1 to 'pairs' (table expected, got nil)
[02/09/2011 17:47:23] stack traceback:
[02/09/2011 17:47:23] 	[C]: in function 'pairs'
[02/09/2011 17:47:23] 	data/creaturescripts/scripts/zombie/onattack.lua:25: in function 'loseOnZombieArena'
[02/09/2011 17:47:23] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

 

olha o meu onattack:

function loseOnZombieArena(cid)
   kickPlayerFromZombiesArea(cid)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")
   local players = getZombiesEventPlayers()
   if(#players <= 1) then
       local winner = players[1]
       if(winner) then
           doPlayerAddItem(winner, 2157, 5, true)
           doPlayerAddItem(winner, 6119, 1, true)
           doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")
           doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")
           kickPlayerFromZombiesArea(winner)
       else
           doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")
       end
       doSetStorage(ZE_STATUS, 0)
       doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)
       doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)
       doSetStorage(ZE_ZOMBIES_SPAWNED, 0)
       local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1
       local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1
       local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}
       for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do
           centerPos.z = z
           for i, uid in pairs(getSpectators(centerPos, width, height, false)) do
               if(isMonster(uid)) then
                   doRemoveCreature(uid)
               end
           end
       end
   end
end

function onStatsChange(target, cid, changetype, combat, value)
   if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
       doCreatureAddHealth(target, getCreatureMaxHealth(target))
       loseOnZombieArena(target)
       return false
   end
   return true
end  

 

2º:Eu gostaria se possivel ter um rank php de quem ganhou mais no zombie event e quem perdeu mais, só pra ter uma diversão :)

 

3º:E tambêm eu queria saber como eu faço um novo char nascer numa ilhazinha e depois virar morador de outra cidade só passando pelo tele que fica no navio da ilha.

 

valeu ae

 

meu ot é yourots 8.6

 

qualé galera, responde ai :/

UP

 

up

 

up

 

:/ forever alone

 

pow galera ajuda aew :S

 

:/ forever alone² (tô comessando a acreditar que ninguem quer ajudar :S)

Editado por Strubol
Link para o comentário
Compartilhar em outros sites

Tente assim

 

function onAttack(cid)
   kickPlayerFromZombiesArea(cid)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")
   local players = getZombiesEventPlayers()
   if(#players <= 1) then
       local winner = players[1]
       if(winner) then
           doPlayerAddItem(winner, 2157, 5, true)
           doPlayerAddItem(winner, 6119, 1, true)
           doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")
           doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")
           kickPlayerFromZombiesArea(winner)
       else
           doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")
       end
       doSetStorage(ZE_STATUS, 0)
       doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)
       doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)
       doSetStorage(ZE_ZOMBIES_SPAWNED, 0)
       local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1
       local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1
       local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}
       for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do
           centerPos.z = z
           for i, uid in pairs(getSpectators(centerPos, width, height, false)) do
               if(isMonster(uid)) then
                   doRemoveCreature(uid)
               end
           end
       end
   end
end

function onStatsChange(target, cid, changetype, combat, value)
   if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
       doCreatureAddHealth(target, getCreatureMaxHealth(target))
       loseOnZombieArena(target)
       return false
   end
   return true
end

Editado por mulizeu
Link para o comentário
Compartilhar em outros sites

Opa, alguem tentando dar uma luz!

:D

 

mano nem deu certo :/

olha o erro q da

[05/09/2011 14:35:19] > Broadcasted message: "Zombie Arena Event started.".

[05/09/2011 14:35:46] [Error - CreatureScript Interface] 
[05/09/2011 14:35:46] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:46] Description: 
[05/09/2011 14:35:46] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:46] stack traceback:
[05/09/2011 14:35:46] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:47] [Error - CreatureScript Interface] 
[05/09/2011 14:35:47] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:47] Description: 
[05/09/2011 14:35:47] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:47] stack traceback:
[05/09/2011 14:35:47] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:49] [Error - CreatureScript Interface] 
[05/09/2011 14:35:49] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:49] Description: 
[05/09/2011 14:35:49] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:49] stack traceback:
[05/09/2011 14:35:49] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:50] [Error - CreatureScript Interface] 
[05/09/2011 14:35:50] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:50] Description: 
[05/09/2011 14:35:50] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:50] stack traceback:
[05/09/2011 14:35:50] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:51] [Error - CreatureScript Interface] 
[05/09/2011 14:35:51] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:51] Description: 
[05/09/2011 14:35:51] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:51] stack traceback:
[05/09/2011 14:35:51] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:51] [Error - CreatureScript Interface] 
[05/09/2011 14:35:51] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:51] Description: 
[05/09/2011 14:35:51] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:51] stack traceback:
[05/09/2011 14:35:51] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:52] [Error - CreatureScript Interface] 
[05/09/2011 14:35:52] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:52] Description: 
[05/09/2011 14:35:52] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:52] stack traceback:
[05/09/2011 14:35:52] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:52] [Error - CreatureScript Interface] 
[05/09/2011 14:35:52] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:52] Description: 
[05/09/2011 14:35:52] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:52] stack traceback:
[05/09/2011 14:35:52] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:53] [Error - CreatureScript Interface] 
[05/09/2011 14:35:53] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:53] Description: 
[05/09/2011 14:35:53] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:53] stack traceback:
[05/09/2011 14:35:53] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:54] [Error - CreatureScript Interface] 
[05/09/2011 14:35:54] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:54] Description: 
[05/09/2011 14:35:54] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:54] stack traceback:
[05/09/2011 14:35:54] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:54] [Error - CreatureScript Interface] 
[05/09/2011 14:35:54] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:54] Description: 
[05/09/2011 14:35:54] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:54] stack traceback:
[05/09/2011 14:35:54] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:54] [Error - CreatureScript Interface] 
[05/09/2011 14:35:54] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:54] Description: 
[05/09/2011 14:35:55] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:55] stack traceback:
[05/09/2011 14:35:55] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:55] [Error - CreatureScript Interface] 
[05/09/2011 14:35:55] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:55] Description: 
[05/09/2011 14:35:55] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:55] stack traceback:
[05/09/2011 14:35:55] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:55] [Error - CreatureScript Interface] 
[05/09/2011 14:35:55] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:55] Description: 
[05/09/2011 14:35:55] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:56] stack traceback:
[05/09/2011 14:35:56] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:56] [Error - CreatureScript Interface] 
[05/09/2011 14:35:56] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:56] Description: 
[05/09/2011 14:35:56] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:56] stack traceback:
[05/09/2011 14:35:56] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:56] [Error - CreatureScript Interface] 
[05/09/2011 14:35:56] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:56] Description: 
[05/09/2011 14:35:56] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:57] stack traceback:
[05/09/2011 14:35:57] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:57] [Error - CreatureScript Interface] 
[05/09/2011 14:35:57] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:57] Description: 
[05/09/2011 14:35:57] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:57] stack traceback:
[05/09/2011 14:35:57] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:58] [Error - CreatureScript Interface] 
[05/09/2011 14:35:58] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:58] Description: 
[05/09/2011 14:35:58] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:58] stack traceback:
[05/09/2011 14:35:58] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:58] [Error - CreatureScript Interface] 
[05/09/2011 14:35:58] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:58] Description: 
[05/09/2011 14:35:58] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:58] stack traceback:
[05/09/2011 14:35:58] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:59] [Error - CreatureScript Interface] 
[05/09/2011 14:35:59] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:59] Description: 
[05/09/2011 14:35:59] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:59] stack traceback:
[05/09/2011 14:35:59] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:35:59] [Error - CreatureScript Interface] 
[05/09/2011 14:35:59] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:35:59] Description: 
[05/09/2011 14:35:59] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:35:59] stack traceback:
[05/09/2011 14:35:59] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:00] [Error - CreatureScript Interface] 
[05/09/2011 14:36:00] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:00] Description: 
[05/09/2011 14:36:00] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:00] stack traceback:
[05/09/2011 14:36:00] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:01] [Error - CreatureScript Interface] 
[05/09/2011 14:36:01] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:01] Description: 
[05/09/2011 14:36:01] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:01] stack traceback:
[05/09/2011 14:36:01] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:02] [Error - CreatureScript Interface] 
[05/09/2011 14:36:02] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:02] Description: 
[05/09/2011 14:36:02] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:02] stack traceback:
[05/09/2011 14:36:02] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:02] [Error - CreatureScript Interface] 
[05/09/2011 14:36:02] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:02] Description: 
[05/09/2011 14:36:02] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:02] stack traceback:
[05/09/2011 14:36:02] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:02] [Error - CreatureScript Interface] 
[05/09/2011 14:36:03] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:03] Description: 
[05/09/2011 14:36:03] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:03] stack traceback:
[05/09/2011 14:36:03] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:03] [Error - CreatureScript Interface] 
[05/09/2011 14:36:03] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:03] Description: 
[05/09/2011 14:36:03] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:03] stack traceback:
[05/09/2011 14:36:03] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:03] [Error - CreatureScript Interface] 
[05/09/2011 14:36:03] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:03] Description: 
[05/09/2011 14:36:03] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:03] stack traceback:
[05/09/2011 14:36:03] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:03] [Error - CreatureScript Interface] 
[05/09/2011 14:36:04] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:04] Description: 
[05/09/2011 14:36:04] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:04] stack traceback:
[05/09/2011 14:36:04] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:04] [Error - CreatureScript Interface] 
[05/09/2011 14:36:04] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:04] Description: 
[05/09/2011 14:36:04] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:04] stack traceback:
[05/09/2011 14:36:04] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:04] [Error - CreatureScript Interface] 
[05/09/2011 14:36:04] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:04] Description: 
[05/09/2011 14:36:04] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:04] stack traceback:
[05/09/2011 14:36:05] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:05] [Error - CreatureScript Interface] 
[05/09/2011 14:36:05] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:05] Description: 
[05/09/2011 14:36:05] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:05] stack traceback:
[05/09/2011 14:36:05] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:05] [Error - CreatureScript Interface] 
[05/09/2011 14:36:05] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:05] Description: 
[05/09/2011 14:36:05] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:05] stack traceback:
[05/09/2011 14:36:05] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:05] [Error - CreatureScript Interface] 
[05/09/2011 14:36:05] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:05] Description: 
[05/09/2011 14:36:05] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:05] stack traceback:
[05/09/2011 14:36:06] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:06] [Error - CreatureScript Interface] 
[05/09/2011 14:36:06] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:06] Description: 
[05/09/2011 14:36:06] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:06] stack traceback:
[05/09/2011 14:36:06] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:06] [Error - CreatureScript Interface] 
[05/09/2011 14:36:06] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:06] Description: 
[05/09/2011 14:36:06] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:06] stack traceback:
[05/09/2011 14:36:06] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:07] [Error - CreatureScript Interface] 
[05/09/2011 14:36:07] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:07] Description: 
[05/09/2011 14:36:07] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:07] stack traceback:
[05/09/2011 14:36:07] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:07] [Error - CreatureScript Interface] 
[05/09/2011 14:36:07] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:07] Description: 
[05/09/2011 14:36:07] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:07] stack traceback:
[05/09/2011 14:36:07] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:07] [Error - CreatureScript Interface] 
[05/09/2011 14:36:07] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:07] Description: 
[05/09/2011 14:36:07] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:07] stack traceback:
[05/09/2011 14:36:08] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:08] [Error - CreatureScript Interface] 
[05/09/2011 14:36:08] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:08] Description: 
[05/09/2011 14:36:08] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:08] stack traceback:
[05/09/2011 14:36:08] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:08] [Error - CreatureScript Interface] 
[05/09/2011 14:36:08] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:08] Description: 
[05/09/2011 14:36:08] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:08] stack traceback:
[05/09/2011 14:36:09] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:09] [Error - CreatureScript Interface] 
[05/09/2011 14:36:09] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:09] Description: 
[05/09/2011 14:36:09] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:09] stack traceback:
[05/09/2011 14:36:09] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:09] [Error - CreatureScript Interface] 
[05/09/2011 14:36:09] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:09] Description: 
[05/09/2011 14:36:09] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:09] stack traceback:
[05/09/2011 14:36:09] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:09] [Error - CreatureScript Interface] 
[05/09/2011 14:36:09] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:09] Description: 
[05/09/2011 14:36:09] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:09] stack traceback:
[05/09/2011 14:36:09] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:10] [Error - CreatureScript Interface] 
[05/09/2011 14:36:10] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:10] Description: 
[05/09/2011 14:36:10] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:10] stack traceback:
[05/09/2011 14:36:10] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:10] [Error - CreatureScript Interface] 
[05/09/2011 14:36:10] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:10] Description: 
[05/09/2011 14:36:10] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:10] stack traceback:
[05/09/2011 14:36:10] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:11] [Error - CreatureScript Interface] 
[05/09/2011 14:36:11] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:11] Description: 
[05/09/2011 14:36:11] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:11] stack traceback:
[05/09/2011 14:36:11] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:11] [Error - CreatureScript Interface] 
[05/09/2011 14:36:11] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:11] Description: 
[05/09/2011 14:36:11] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:11] stack traceback:
[05/09/2011 14:36:11] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:11] [Error - CreatureScript Interface] 
[05/09/2011 14:36:11] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:11] Description: 
[05/09/2011 14:36:11] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:11] stack traceback:
[05/09/2011 14:36:11] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:12] [Error - CreatureScript Interface] 
[05/09/2011 14:36:12] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:12] Description: 
[05/09/2011 14:36:12] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:12] stack traceback:
[05/09/2011 14:36:12] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:12] [Error - CreatureScript Interface] 
[05/09/2011 14:36:12] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:12] Description: 
[05/09/2011 14:36:12] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:12] stack traceback:
[05/09/2011 14:36:12] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

[05/09/2011 14:36:12] [Error - CreatureScript Interface] 
[05/09/2011 14:36:12] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 14:36:12] Description: 
[05/09/2011 14:36:12] data/creaturescripts/scripts/zombie/onattack.lua:37: attempt to call global 'loseOnZombieArena' (a nil value)
[05/09/2011 14:36:12] stack traceback:
[05/09/2011 14:36:12] 	data/creaturescripts/scripts/zombie/onattack.lua:37: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>

 

Mais tipo, o bug que eu postei no primeiro post eu consegui arrumar pegando uma lib do vodkart de pokemon, mesmo meu ot não sendo de pokemon :)

 

Más só falta fazer os zumbis serem removidos depois que o evento acabar, tem como dar uma ajudada?

só colocando um comando que quando acaba o evento os zumbis desapareçam..

 

vlw :)

Link para o comentário
Compartilhar em outros sites

aa tende tente assim entao!

 

function loseOnZombieArena(cid)
   kickPlayerFromZombiesArea(cid)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")
   local players = getZombiesEventPlayers()
   if(#players <= 1) then
       local winner = players[1]
       if(winner) then
           doPlayerAddItem(winner, 2157, 5, true)
           doPlayerAddItem(winner, 6119, 1, true)
           doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")
           doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")
           kickPlayerFromZombiesArea(winner)
           kickSummonFromZombiesArea(winner)
       else
           doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")
       end
       doSetStorage(ZE_STATUS, 0)
       doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)
       doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)
       doSetStorage(ZE_ZOMBIES_SPAWNED, 0)
       local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1
       local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1
       local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}
       for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do
           centerPos.z = z
           for i, uid in pairs(getSpectators(centerPos, width, height, false)) do
               if(isMonster(uid)) then
                   doRemoveCreature(uid)
               end
           end
       end
   end
end

function onStatsChange(target, cid, changetype, combat, value)
   if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
       doCreatureAddHealth(target, getCreatureMaxHealth(target))
       loseOnZombieArena(target)
       return false
   end
   return true
end  

Link para o comentário
Compartilhar em outros sites

bem, na primeira vez que eu dei /zombiestart e quando acabou o evento, os zumbis foram removidos, más na segunda vez que iniciei o event os zumbis não foram removidos..

:/

é que tipo, esse evento vai ser um evento que vai ter 1 vez por dia automatico.. más ainda vou implantar isso..

se fosse via comando eu só dava goto e matava os zumbis, más eu quero que remova automatico..

 

vlw

Link para o comentário
Compartilhar em outros sites

Tenta esse entao!

 

function loseOnZombieArena(cid)
   kickPlayerFromZombiesArea(cid)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")
   local players = getZombiesEventPlayers()
   if(#players <= 1) then
       local winner = players[1]
       if(winner) then
           doPlayerAddItem(winner, 2157, 5, true)
           doPlayerAddItem(winner, 6119, 1, true)
           doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")
           doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")
           kickPlayerFromZombiesArea(winner)
           elseif getSummonFromZombiesArea(cid,os.time) == TRUE then
           kickSummonFromZombiesArea(winner)
       else
           doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")
       end
       doSetStorage(ZE_STATUS, 0)
       doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)
       doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)
       doSetStorage(ZE_ZOMBIES_SPAWNED, 0)
       local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1
       local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1
       local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}
       for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do
           centerPos.z = z
           for i, uid in pairs(getSpectators(centerPos, width, height, false)) do
               if(isMonster(uid)) then
                   doRemoveCreature(uid)
               end
           end
       end
   end
end

function onStatsChange(target, cid, changetype, combat, value)
   if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
       doCreatureAddHealth(target, getCreatureMaxHealth(target))
       loseOnZombieArena(target)
       return false
   end
   return true
end

Editado por mulizeu
Link para o comentário
Compartilhar em outros sites

deu esse erro

[05/09/2011 17:24:25] [Error - CreatureScript Interface] 
[05/09/2011 17:24:25] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 17:24:25] Description: 
[05/09/2011 17:24:25] data/creaturescripts/scripts/zombie/onattack.lua:13: attempt to call global 'getSummonFromZombiesArea' (a nil value)
[05/09/2011 17:24:25] stack traceback:
[05/09/2011 17:24:25] 	data/creaturescripts/scripts/zombie/onattack.lua:13: in function 'loseOnZombieArena'
[05/09/2011 17:24:25] 	data/creaturescripts/scripts/zombie/onattack.lua:39: in function <data/creaturescripts/scripts/zombie/onattack.lua:36>

Link para o comentário
Compartilhar em outros sites

=] tenta assim entao!

 

function loseOnZombieArena(cid)
   kickPlayerFromZombiesArea(cid)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")
   local players = getZombiesEventPlayers()
   if(#players <= 1) then
       local winner = players[1]
       if(winner) then
           doPlayerAddItem(winner, 2157, 5, true)
           doPlayerAddItem(winner, 6119, 1, true)
           doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")
           doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")
           kickPlayerFromZombiesArea(winner)
                       elseif getCreatureSummon(cid) == TRUE then
           kickSummonFromZombiesArea(winner) 
       else
           doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")
       end
       doSetStorage(ZE_STATUS, 0)
       doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)
       doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)
       doSetStorage(ZE_ZOMBIES_SPAWNED, 0)
       local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1
       local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1
       local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}
       for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do
           centerPos.z = z
           for i, uid in pairs(getSpectators(centerPos, width, height, false)) do
               if(isMonster(uid)) then
                   doRemoveCreature(uid)
               end
           end
       end
   end
end

function onStatsChange(target, cid, changetype, combat, value)
   if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
       doCreatureAddHealth(target, getCreatureMaxHealth(target))
       loseOnZombieArena(target)
       return false
   end
   return true
end

Link para o comentário
Compartilhar em outros sites

deu isso :/

[05/09/2011 17:40:07] [Error - CreatureScript Interface] 
[05/09/2011 17:40:07] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 17:40:07] Description: 
[05/09/2011 17:40:07] data/creaturescripts/scripts/zombie/onattack.lua:13: attempt to call global 'getCreatureSummon' (a nil value)
[05/09/2011 17:40:07] stack traceback:
[05/09/2011 17:40:07] 	data/creaturescripts/scripts/zombie/onattack.lua:13: in function 'loseOnZombieArena'
[05/09/2011 17:40:07] 	data/creaturescripts/scripts/zombie/onattack.lua:39: in function <data/creaturescripts/scripts/zombie/onattack.lua:36>

Link para o comentário
Compartilhar em outros sites

Ouxe!skasako

 

Tenta assim entaum

 

function loseOnZombieArena(cid)
   kickPlayerFromZombiesArea(cid)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")
   local players = getZombiesEventPlayers()
   if(#players <= 1) then
       local winner = players[1]
       if(winner) then
           doPlayerAddItem(winner, 2157, 5, true)
           doPlayerAddItem(winner, 6119, 1, true)
           doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")
           doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")
           kickPlayerFromZombiesArea(winner)
          elseif getSummonZombiesEventStatus(winner) == TRUE then
           kickSummonFromZombiesArea(winner)
       else
           doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")
       end
       doSetStorage(ZE_STATUS, 0)
       doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)
       doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)
       doSetStorage(ZE_ZOMBIES_SPAWNED, 0)
       local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1
       local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1
       local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}
       for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do
           centerPos.z = z
           for i, uid in pairs(getSpectators(centerPos, width, height, false)) do
               if(isMonster(uid)) then
                   doRemoveCreature(uid)
               end
           end
       end
   end
end

function onStatsChange(target, cid, changetype, combat, value)
   if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
       doCreatureAddHealth(target, getCreatureMaxHealth(target))
       loseOnZombieArena(target)
       return false
   end
   return true
end[code]

[/code]

Editado por mulizeu
Link para o comentário
Compartilhar em outros sites

caraca q trampo :/

deu esse erro dnv :-(

[05/09/2011 18:00:42] [Error - CreatureScript Interface] 
[05/09/2011 18:00:42] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[05/09/2011 18:00:42] Description: 
[05/09/2011 18:00:42] data/creaturescripts/scripts/zombie/onattack.lua:13: attempt to call global 'getSummonZombiesEventStatus' (a nil value)
[05/09/2011 18:00:42] stack traceback:
[05/09/2011 18:00:42] 	data/creaturescripts/scripts/zombie/onattack.lua:13: in function 'loseOnZombieArena'
[05/09/2011 18:00:42] 	data/creaturescripts/scripts/zombie/onattack.lua:39: in function <data/creaturescripts/scripts/zombie/onattack.lua:36>

Link para o comentário
Compartilhar em outros sites

Ve esse ake..=]

 

function loseOnZombieArena(cid)
   kickPlayerFromZombiesArea(cid)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")
   local players = getZombiesEventPlayers()
   if(#players <= 1) then
       local winner = players[1]
       if(winner) then
           doPlayerAddItem(winner, 2157, 5, true)
           doPlayerAddItem(winner, 6119, 1, true)
           doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")
           doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")
           kickPlayerFromZombiesArea(winner) 
           kickSummonFromZombiesArea(winner)
       else
           doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")
       end
       doSetStorage(ZE_STATUS, 0)
       doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)
       doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)
       doSetStorage(ZE_ZOMBIES_SPAWNED, 0)
       local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1
       local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1
       local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}
       for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do
           centerPos.z = z
           for i, uid in pairs(getSpectators(centerPos, width, height, false)) do
               if(isMonster(uid)) then
                   doRemoveCreature(uid)
               end
           end
       end
   end
end

function onStatsChange(target, cid, changetype, combat, value)
   if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
       doCreatureAddHealth(target, getCreatureMaxHealth(target))
       loseOnZombieArena(target)
       return false
   end
   return true
end

Link para o comentário
Compartilhar em outros sites

Nossa mano, essa foi perto, tipow, eu criei um primeiro evento, no primeiro os 2 zumbis foram sumonados e eles sumiram, no segundo eu deixei sumonar uns 8 zumbis, ai sumiram 6 e restaram 2, eu to achando que os zumbis que foram sumonados no evento anterior não somem no proximo evento..

 

mais tenta aew pq eu acho q ta perto..

 

:D

vlw

 

.-.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...