Ir para conteúdo

Featured Replies

Postado

Pessoal, implantei o evento Defend The king no meu server está tudo certo, porém na hora que é destruído o Gate aparece o seguinte erro:

 

blob.png.1e316005278f5ab6a93474430895ff30.png

 

Não tenho nem noção de onde está vindo este erro :/

 

Alguém tem noção?

  • Respostas 5
  • Visualizações 498
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado
  • Autor
4 horas atrás, Everson Miranda disse:

@crk posta ai o script

Everton, qual parte do script? eu estou com dúvida de onde ta vindo o erro

Postado
  • Autor
1 hora atrás, Everson Miranda disse:

@crk provavelmente é em creature script posta ai o seu creature script

death_gate.lua

Spoiler

dofile("config-dtk.lua")

function onDeath(cid, corpse, deathList)
                
for i,v in pairs(getPositionsWithFloor(position_gate,floor))  do
    local fence = getThingFromId(gate_id,v)
    if fence ~= FALSE then
       doRemoveItem(fence.uid) 
    end
end        
doSendMessageForAll(MESSAGE_STATUS_WARNING,"The gate was destroyed!")
return TRUE
end

 

death_king.lua

Spoiler

dofile("config-dtk.lua")
function onKill(cid, target, lastHit)
if getCreatureName(target):lower() == "the king" and getPlayerGroup(cid) == "attacker" then
   doSendMessageForAll(14,"The king was killed by ".. getCreatureName(cid))
   for _,name in pairs(getDefendPlayersAttacker()) do
             doPlayerSendTextMessage(getCreatureByName(name),MESSAGE_STATUS_CONSOLE_ORANGE,"Congratulations Attackers, you are the winner of Defend the King!")
   end
   for _,name in pairs(getDefendPlayersDefender()) do
             doPlayerSendTextMessage(getCreatureByName(name),MESSAGE_STATUS_CONSOLE_ORANGE,"You Lost the event Defend The King!")
   end
   for _,info in pairs(getDefendPlayersInEvent()) do
       if isPlayerOnline(info.name) then
          local pid = getCreatureByName(info.name)
          doTeleportThing(pid,getTownTemplePosition(getPlayerTown(pid)))
          if getPlayerGroup(pid) == "attacker" then
             premio = doPlayerAddItem(pid,premios[math.random(1,#premios)])
             doPlayerSendTextMessage(pid,MESSAGE_EVENT_DEFAULT,"You gain 1 ".. getItemName(premio).."")
          end
       end                
   end
   setGlobalStorageValue(controle_king_death,1)
   doCancelEvent(all_storage,tp_pos,position_gate,position_gate_main,gate_id)
end
return TRUE
end

 

king-combat.lua

Spoiler

dofile("config-dtk.lua")
voices = {"Oh god.","o.O help help help","I'll deeead!","HELP","Heeelp","Heeeeeelp me pleeeease"}

function onCombat(cid, target)
if getCreatureName(target):lower() == "the king" then 
   if getPlayerGroup(cid) == "defender" then 
      if getEscolhido():lower() == getCreatureName(cid):lower() then
         if getGlobalStorageValue(controle_walk_king) == -1 then
            doChangeSpeed(target, -getCreatureSpeed(target))
            setGlobalStorageValue(controle_walk_king,1)
            doCreatureSay(cid, "Stop here my Lord!", 1)
            doCreatureSay(target, "ok", 1)
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"The king is stop.")
         else
            doChangeSpeed(target,getCreatureBaseSpeed(target))
            setGlobalStorageValue(controle_walk_king,-1)
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"The king is following you.")
            doCreatureSay(cid, "Follow me my Lord!", 1)
            doCreatureSay(target, "All right!", 1)
         end
      end
      return FALSE
   else
      if getGlobalStorageValue(controle_voice) == -1 then
         doCreatureSay(target, voices[math.random(1,#voices)], 1)
         for _,name in pairs(getDefendPlayersDefender()) do
             doPlayerSendTextMessage(getCreatureByName(name),MESSAGE_INFO_DESCR,"Your king is under attack. Defend him.")
         end
         setGlobalStorageValue(controle_voice,1)
         addEvent(reset,6000,controle_voice) 
      end
      return TRUE
   end
else
return TRUE
end
end

function reset(storage_global)
setGlobalStorageValue(storage_global,-1)
end

 

player_death.lua

Spoiler

dofile("config-dtk.lua")
function onPrepareDeath(cid, deathList)
         if getPlayerStorageValue(cid,death_times) == -1 then setPlayerStorageValue(cid,death_times,1) end
         local delay = 0
         local times = 5*getPlayerStorageValue(cid,death_times)
         doCreatureSetNoMove(cid,TRUE)
         setPlayerStorageValue(cid,controle_in_delay,1)
         for i=times,0,-1 do
                addEvent(doMessageWithCheck,delay,cid,MESSAGE_STATUS_CONSOLE_ORANGE,"Respawn to back: "..i)
                delay = 2000 + delay                 
                if i == 0 then
                   addEvent(doMovePlayer,delay+1000,cid)
                end
         end
         
return TRUE
end

function onDeath(cid, deathList)
doConvinceCreature(getGlobalStorageValue(controle_convince_pid),cid)
return TRUE
end

function doMessageWithCheck(cid,type,msg)
if isPlayerOnline(getCreatureName(cid)) and getGlobalStorageValue(controle_atived) ~= -1 then
   doPlayerSendTextMessage(cid,type,msg)
else
    stopEvent(doMessageWithCheck)
end
return TRUE
end

function doMovePlayer(cid)
         if isPlayerOnline(getCreatureName(cid)) and getGlobalStorageValue(controle_atived) ~= -1 then 
               doCreatureSetNoMove(cid, FALSE)
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Go Go GO!")
               setPlayerStorageValue(cid,death_times,getPlayerStorageValue(cid,death_times)+1)
               setPlayerStorageValue(cid,controle_in_delay,-1)
         end
end

 

player-combat.lua

Spoiler

function onCombat(cid, target)
if isPlayer(cid) then
   if getPlayerGroup(cid) ~= getPlayerGroup(target) and getGlobalStorageValue(controle_round) == 1 then
      return TRUE
   else
       return FALSE
   end
end
end

 

sincronia.lua

Spoiler

dofile("config-dtk.lua")
function onThink(pid, interval)
    if isCreature(pid) then
       cid = getCreatureMaster(pid)       -- Player que sumonou
       pos = getCreaturePosition(cid)     -- Posiçao do player que sumonou
       pos_summon = getCreaturePosition(pid)          
       if pos.z ~= pos_summon.z and getGlobalStorageValue(controle_walk_king) == -1 then
          doTeleportThing(pid,pos)
          doSendMagicEffect(pos,2)
          doSendMagicEffect(pos_summon,2)
       end
    end
return TRUE
end

-- 36 animated efeito

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo