Ir para conteúdo
  • 0

Erro Biohazard


Nathan Fischer

Pergunta

TOU COM O SEGUINTE ERRO NO EVENTO BIOHAZARD

QUANDO O ZOMBIE ATACA O PLAYER TA ESSE ERRO E ELE N HITA

 

 

 

[23/09/2012 20:07:12] [Error - CreatureScript Interface]

[23/09/2012 20:07:12] data/creaturescripts/scripts/biohazard/statschange.lua:onStatsChange

[23/09/2012 20:07:12] Description:

[23/09/2012 20:07:12] ...ta/creaturescripts/scripts/biohazard/statschange.lua:5: attempt to call global 'getCreatureHealth' (a nil value)

[23/09/2012 20:07:12] stack traceback:

[23/09/2012 20:07:12] ...ta/creaturescripts/scripts/biohazard/statschange.lua:5: in function <...ta/creaturescripts/scripts/biohazard/statschange.lua:1>

 

 

SCRIPT >>

 

 

function onStatsChange(cid, attacker, type, combat, value)

if isPlayer(cid) and isPlayer(attacker) then

if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then

if getBiohazardPlayerStatus(cid) == 1 and (isNemesis(attacker) or getCreatureName(attacker) == "Zombie") then

if getCreatureHealth(cid) - value <= 0 then

local zombie = doCreateMonster("Biohazard", getThingPosition(cid))

doConvinceCreature(attacker, zombie)

doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

doBiohazardKickPlayer(cid)

doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Perdeu!! Voce foi infectado.")

 

local players = getBiohazardEventPlayers()

if #players == 1 then

local player = players[1]

doPlayerAddItem(player, 11367, 1)

doPlayerSendTextMessage(player, MESSAGE_EVENT_ADVANCE, "Voce ganhou o evento como Zombie.")

doBroadcastMessage(getCreatureName(player) .."é o Zombie e infectou todos humanos.")

for _, summon in ipairs(getCreatureSummons(player)) do

doRemoveCreature(summon)

end

doBiohazardKickPlayer(player)

doSetStorage(BIOHAZARD_GLOBAL_STATUS, 0)

doSetStorage(BIOHAZARD_GLOBAL_MAX_PLAYERS, BIOHAZARD_DEFAULT_MAX_PLAYERS)

end

return false

end

elseif isNemesis(cid) and getBiohazardPlayerStatus(attacker) == 1 then

doCreatureSetStorage(cid, BIOHAZARD_PLAYER_NEMESIS_HEALTH, getCreatureStorage(cid, BIOHAZARD_PLAYER_NEMESIS_HEALTH) - value)

doCreatureSay(cid, getCreatureStorage(cid, BIOHAZARD_PLAYER_NEMESIS_HEALTH), TALKTYPE_ORANGE_1)

if getCreatureStorage(cid, BIOHAZARD_PLAYER_NEMESIS_HEALTH) - value <= 0 then

local players = getBiohazardEventPlayers()

for _, player in ipairs(players) do

if getBiohazardPlayerStatus(player) == 1 then

doPlayerAddItem(player, 11367, 1)

doPlayerSendTextMessage(player, MESSAGE_EVENT_DEFAULT, "Voce ganhou o evento como Zombie.")

end

doBiohazardKickPlayer(player)

end

doBroadcastMessage("Os humanos sobreviveram ao virus.")

doSetStorage(BIOHAZARD_GLOBAL_STATUS, 0)

doSetStorage(BIOHAZARD_GLOBAL_MAX_PLAYERS, BIOHAZARD_DEFAULT_MAX_PLAYERS)

end

return false

elseif getBiohazardPlayerStatus(cid) == 1 and getBiohazardPlayerStatus(attacker) == 1 then

return false

end

end

end

return true

end

 

 

 

REP+ PRA QUEM AJUDAR

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...