cê alguem puder da a luz para esse cara eu agradeço também.. seus scripts me ajudaram muito.
function onStatsChange(cid, attacker, type, combat, value)
local artigo = getPlayerSex(cid) == 0 and "comida" or "comido"
local max_hits = 3 --Quantos hits o jogador irá levar, no máximo. 3 = 3 hits do Zombie.
if getCreatureName(attacker) == "Event Zombie" and isInArea(getCreaturePosition(cid), amoebaZombie.fromPosition, amoebaZombie.toPosition) then
if type == STATSCHANGE_HEALTHLOSS then
if getPlayerStorageValue(cid, 834412) <= (max_hits - 2) then
setPlayerStorageValue(cid, 834412, getPlayerStorageValue(cid, 834412) + 1)
else
if getGlobalStorageValue(amoebaZombie.playerStorage) > 2 then
setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doBroadcastMessage(getPlayerName(cid) .." foi " .. artigo .. " pelos zombies!")
doPlayerAddItem(cid, amoebaZombie.consolo[1], amoebaZombie.consolo[2])
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, 834412, 0)
elseif getGlobalStorageValue(amoebaZombie.playerStorage) == 2 then
setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doBroadcastMessage(getPlayerName(cid) .." foi " .. artigo .. " pelos zombies!")
doPlayerAddItem(cid, amoebaZombie.consolo[1], amoebaZombie.consolo[2])
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, 834412, 0)
addEvent(winZombieEvent, 1000)
addEvent(removeZombies, 1000)
end
end
end
end
return true
end
Editado Dezembro 22 por zipter98
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

Ótima idéia, Zipter, muito obrigado!
Vou pensar se posto o evento também pro pessoal
Edit: Infelizmente meu servidor ta fechando toda vez que o Zombie da os X hits, não to entendendo pq...
Editado Dezembro 23 por amoeba13
Estranho, testei aqui e tá funcionando direitinho
(claro, tive que editar algumas coisas pra funcionar: criar as funções e a tabela)
Seu servidor tá fechando em ambas as ocasiões (storage global maior que 2 e igual a 2)?
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

ixi =S, ele fecha assim que o Zombie dá o terceiro hit (máximo), ou seja, na hora de executar oq ta debaixo do else
Só pra confirmar uma coisa: retire tudo que está abaixo do else, e coloque um simples
print("test")
O server continua fechando, ou imprime o "test"?
Editado Dezembro 23 por zipter98
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

Ele imprimiu certinho... =S
Hm, dessas duas seguintes maneiras, o servidor fecha, ou ocorre certinho o quê está escrito no código?
function onStatsChange(cid, attacker, type, combat, value)
local artigo = getPlayerSex(cid) == 0 and "comida" or "comido"
local max_hits = 3 --Quantos hits o jogador irá levar, no máximo. 3 = 3 hits do Zombie.
if getCreatureName(attacker) == "Event Zombie" and isInArea(getCreaturePosition(cid), amoebaZombie.fromPosition, amoebaZombie.toPosition) then
if type == STATSCHANGE_HEALTHLOSS then
if getPlayerStorageValue(cid, 834412) <= (max_hits - 2) then
setPlayerStorageValue(cid, 834412, getPlayerStorageValue(cid, 834412) + 1)
else
setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doBroadcastMessage(getPlayerName(cid) .." foi " .. artigo .. " pelos zombies!")
doPlayerAddItem(cid, amoebaZombie.consolo[1], amoebaZombie.consolo[2])
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, 834412, 0)
addEvent(winZombieEvent, 1000)
addEvent(removeZombies, 1000)
end
end
end
return true
end
function onStatsChange(cid, attacker, type, combat, value)
local artigo = getPlayerSex(cid) == 0 and "comida" or "comido"
local max_hits = 3 --Quantos hits o jogador irá levar, no máximo. 3 = 3 hits do Zombie.
if getCreatureName(attacker) == "Event Zombie" and isInArea(getCreaturePosition(cid), amoebaZombie.fromPosition, amoebaZombie.toPosition) then
if type == STATSCHANGE_HEALTHLOSS then
if getPlayerStorageValue(cid, 834412) <= (max_hits - 2) then
setPlayerStorageValue(cid, 834412, getPlayerStorageValue(cid, 834412) + 1)
else
setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doBroadcastMessage(getPlayerName(cid) .." foi " .. artigo .. " pelos zombies!")
doPlayerAddItem(cid, amoebaZombie.consolo[1], amoebaZombie.consolo[2])
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, 834412, 0)
end
end
end
return true
endEditado Dezembro 23 por zipter98
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

Das duas maneiras o servidor fecou... to quebrando minha cabeça aqui tbm
Hm, agora realmente complicou. Não tenho a mínima ideia do quê está fazendo seu servidor cair. Aparentemente, está tudo certinho (como eu disse, funcionou aqui). O jeito vai ser ir testando de linha em linha. Talvez seja uma única função usada que está causando isso. Se esta for descoberta, ficará mais fácil resolver.
Se não se importar, poderia ir testando cada vez com uma função diferente após o else? Por exemplo,
function onStatsChange(cid, attacker, type, combat, value)
local artigo = getPlayerSex(cid) == 0 and "comida" or "comido"
local max_hits = 3 --Quantos hits o jogador irá levar, no máximo. 3 = 3 hits do Zombie.
if getCreatureName(attacker) == "Event Zombie" and isInArea(getCreaturePosition(cid), amoebaZombie.fromPosition, amoebaZombie.toPosition) then
if type == STATSCHANGE_HEALTHLOSS then
if getPlayerStorageValue(cid, 834412) <= (max_hits - 2) then
setPlayerStorageValue(cid, 834412, getPlayerStorageValue(cid, 834412) + 1)
else
setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1)
end
end
end
return true
end
function onStatsChange(cid, attacker, type, combat, value)
local artigo = getPlayerSex(cid) == 0 and "comida" or "comido"
local max_hits = 3 --Quantos hits o jogador irá levar, no máximo. 3 = 3 hits do Zombie.
if getCreatureName(attacker) == "Event Zombie" and isInArea(getCreaturePosition(cid), amoebaZombie.fromPosition, amoebaZombie.toPosition) then
if type == STATSCHANGE_HEALTHLOSS then
if getPlayerStorageValue(cid, 834412) <= (max_hits - 2) then
setPlayerStorageValue(cid, 834412, getPlayerStorageValue(cid, 834412) + 1)
else
setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
end
end
end
return true
endfunction onStatsChange(cid, attacker, type, combat, value)
local artigo = getPlayerSex(cid) == 0 and "comida" or "comido"
local max_hits = 3 --Quantos hits o jogador irá levar, no máximo. 3 = 3 hits do Zombie.
if getCreatureName(attacker) == "Event Zombie" and isInArea(getCreaturePosition(cid), amoebaZombie.fromPosition, amoebaZombie.toPosition) then
if type == STATSCHANGE_HEALTHLOSS then
if getPlayerStorageValue(cid, 834412) <= (max_hits - 2) then
setPlayerStorageValue(cid, 834412, getPlayerStorageValue(cid, 834412) + 1)
else
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
end
end
end
return true
endfunction onStatsChange(cid, attacker, type, combat, value)
local artigo = getPlayerSex(cid) == 0 and "comida" or "comido"
local max_hits = 3 --Quantos hits o jogador irá levar, no máximo. 3 = 3 hits do Zombie.
if getCreatureName(attacker) == "Event Zombie" and isInArea(getCreaturePosition(cid), amoebaZombie.fromPosition, amoebaZombie.toPosition) then
if type == STATSCHANGE_HEALTHLOSS then
if getPlayerStorageValue(cid, 834412) <= (max_hits - 2) then
setPlayerStorageValue(cid, 834412, getPlayerStorageValue(cid, 834412) + 1)
else
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doBroadcastMessage(getPlayerName(cid) .." foi " .. artigo .. " pelos zombies!")
end
end
end
return true
endEditado Dezembro 23 por zipter98
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

Zipter eu não tenho idéia do pq de isso não ter funcionado, mas eu testei assim e funcionou certinho:
function onStatsChange(cid, attacker, type, combat, value)
local artigo = getPlayerSex(cid) == 0 and "comida" or "comido"
if isPlayer(cid) and getCreatureName(attacker) == "Event Zombie" and isInArea(getCreaturePosition(cid), amoebaZombie.fromPosition, amoebaZombie.toPosition) then
if getPlayerStorageValue(cid, 28193) < 3 then
doPlayerSetStorageValue(cid, 28193, getPlayerStorageValue(cid, 28193)+1)
else
if getGlobalStorageValue(amoebaZombie.playerStorage) > 2 then
doPlayerSetStorageValue(cid, 28913, 0)
setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doBroadcastMessage(getPlayerName(cid) .." foi " .. artigo .. " pelos zombies!")
doPlayerAddItem(cid, amoebaZombie.consolo[1], amoebaZombie.consolo[2])
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
elseif getGlobalStorageValue(amoebaZombie.playerStorage) == 2 then
setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1)
doPlayerSetStorageValue(cid, 28913, 0)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doBroadcastMessage(getPlayerName(cid) .." foi " .. artigo .. " pelos zombies!")
doPlayerAddItem(cid, amoebaZombie.consolo[1], amoebaZombie.consolo[2])
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
addEvent(winZombieEvent, 1000)
addEvent(removeZombies, 1000)
end
end
end
return true
end
Obrigado pela ajuda ![]()





info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem
Eu cansei de procurar um Zombie Event que funcionasse sem problema e resolvi fazer um do zero. Eu fiz, e ficou tudo certo, funcionando exatamente como eu queria.
A minha dúvida é na parte do Creaturescritps... Meu zombie da somente um hit no player e o player já sofre ação do script. Eu queria fazer de um jeito que o player tivesse que levar uns 3 hits pelo menos, mas não estou conseguindo pensar em como fazer isso...
Se alguém puder me dar uma luz eu agradeceria.
Meu script:
function onStatsChange(cid, attacker, type, combat, value) local artigo = getPlayerSex(cid) == 0 and "comida" or "comido" if getCreatureName(attacker) == "Event Zombie" and isInArea(getCreaturePosition(cid), amoebaZombie.fromPosition, amoebaZombie.toPosition) then if getGlobalStorageValue(amoebaZombie.playerStorage) > 2 then setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1) local corpse = doCreateItem(3058, 1, getPlayerPosition(cid)) doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".") doBroadcastMessage(getPlayerName(cid) .." foi " .. artigo .. " pelos zombies!") doPlayerAddItem(cid, amoebaZombie.consolo[1], amoebaZombie.consolo[2]) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) elseif getGlobalStorageValue(amoebaZombie.playerStorage) == 2 then setGlobalStorageValue(amoebaZombie.playerStorage, getGlobalStorageValue(amoebaZombie.playerStorage)-1) local corpse = doCreateItem(3058, 1, getPlayerPosition(cid)) doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".") doBroadcastMessage(getPlayerName(cid) .." foi " .. artigo .. " pelos zombies!") doPlayerAddItem(cid, amoebaZombie.consolo[1], amoebaZombie.consolo[2]) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) addEvent(winZombieEvent, 1000) addEvent(removeZombies, 1000) end end return true endEditado Dezembro 22 por amoeba13