Ir para conteúdo
Banner com Efeitos

Featured Replies

  • Respostas 35
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • function onStatsChange(cid, attacker, type, combat, value) if(isPlayer(cid) and not isPlayer(attacker) and exhaustion.check(cid, 23585) and (type == STATSCHANGE_MANALOSS or type == STATSCHANGE_HEALTHL

  • Irei editar aqui no meu server até funcionar.  Finalmente.

Postado

O tópico foi movido para a área correta, preste mais atenção da próxima vez!

Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680

Este tópico foi movido:

De: "OTServScriptingCreatureScripts, GlobalEvents e MoveMents"

Para: "OTServSuporte OTServSuporte de Scripts"

Postado

Tenta:
data/creaturescripts/scripts

function onLogin(cid)

local tempo = 5 -- tempo de proteção em segundos
local storage = 23585 -- só mecha se souber o que faz

if isPlayer(cid) then
   exhaustion.set(cid, storage, tempo)
    doPlayerSendTextMessage(cid, 22, "Você está protegido por 5 segundos!")
    registerCreatureEvent(cid, "Protection")
     end
      return true
       end

function onAttack(cid, target)

if exhaustion.check(target, 23585) then
     doPlayerSendTextMessage(cid, 22, "Este player está protegido!")
	 end
     return false
     end

creaturescripts.xml:

<event type="login" name="Protect" event="script" value="arquivo.lua"/>     
    <event type="attack" name="Protection" event="script" value="arquivo.lua"/>   

Primeira vez que mecho com onAttack.

Postado
  • Autor

 

Tenta:

data/creaturescripts/scripts

function onLogin(cid)

local tempo = 5 -- tempo de proteção em segundos
local storage = 23585 -- só mecha se souber o que faz

if isPlayer(cid) then
   exhaustion.set(cid, storage, tempo)
    doPlayerSendTextMessage(cid, 22, "Você está protegido por 5 segundos!")
    registerCreatureEvent(cid, "Protection")
     end
      return true
       end

function onAttack(cid, target)

if exhaustion.check(target, 23585) then
     doPlayerSendTextMessage(cid, 22, "Este player está protegido!")
	 end
     return false
     end

creaturescripts.xml:

<event type="login" name="Protect" event="script" value="arquivo.lua"/>     
    <event type="attack" name="Protection" event="script" value="arquivo.lua"/>   

Primeira vez que mecho com onAttack.

 

 

não deu certo, ao logar os bixos conseguem atacar o player :/

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.7k

Informação Importante

Confirmação de Termo