Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

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_HEALTHLOSS)) then
doCreatureAddHealth(cid, math.abs(value))
doPlayerSendTextMessage(cid, 24,"Você tem mais "..exhaustion.get(cid, 23585).." segundos de proteção!")
end
end

Acho que é minha última tentativa hehe

Se não funcionar tenta com outro char, talvez esse aí tenha bugado com o outro script 

Editado por Danves (veja o histórico de edições)



 tumblr_mwfeg45FIV1qk4cb3o4_500.gif

  • 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
  • Autor
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_HEALTHLOSS)) then
doCreatureAddHealth(cid, math.abs(value))
doPlayerSendTextMessage(cid, 24,"Você tem mais "..exhaustion.get(cid, 23585).." segundos de proteção!")
end
end

Acho que é minha última tentativa hehe

Se não funcionar tenta com outro char, talvez esse aí tenha bugado com o outro script 

 

 

é, nada :/ vlw pela boa vontade :) rep +

Postado

Irei editar aqui no meu server até funcionar.  :accepted:


Finalmente.

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_HEALTHLOSS)) then
doPlayerSendTextMessage(cid, 22,"Você tem mais "..exhaustion.get(cid, 23585).." segundos de proteção!")
doSendMagicEffect(getThingPos(cid), 2)
return false
end
return true
end



__________________________________________________

Resumindo o script, basta ter um script com nome "protect.lua" com isso dentro:


function onLogin(cid)
local tempo = 5 -- tempo de proteção em segundos


if isPlayer(cid) then
   exhaustion.set(cid, 23585, tempo)
    doPlayerSendTextMessage(cid, 22, "Você está protegido por 5 segundos!")
    registerCreatureEvent(cid, "Protection")
    registerCreatureEvent(cid, "Protect")
     end
      return true
       end
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_HEALTHLOSS)) then
doPlayerSendTextMessage(cid, 22,"Você tem mais "..exhaustion.get(cid, 23585).." segundos de proteção!")
doSendMagicEffect(getThingPos(cid), 2)
return false
end
return true
end


E no creaturescripts.xml ter:


<event type="login" name="Protect" event="script" value="protect.lua"/>     
<event type="statschange" name="Protection" event="script" value="protect.lua"/>  
 

Editado por Danves (veja o histórico de edições)



 tumblr_mwfeg45FIV1qk4cb3o4_500.gif

Postado
  • Autor

 

Irei editar aqui no meu server até funcionar.  :accepted:

Finalmente.

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_HEALTHLOSS)) then
doPlayerSendTextMessage(cid, 22,"Você tem mais "..exhaustion.get(cid, 23585).." segundos de proteção!")
doSendMagicEffect(getThingPos(cid), 2)
return false
end
return true
end

__________________________________________________

Resumindo o script, basta ter um script com nome "protect.lua" com isso dentro:

function onLogin(cid)
local tempo = 5 -- tempo de proteção em segundos


if isPlayer(cid) then
   exhaustion.set(cid, 23585, tempo)
    doPlayerSendTextMessage(cid, 22, "Você está protegido por 5 segundos!")
    registerCreatureEvent(cid, "Protection")
    registerCreatureEvent(cid, "Protect")
     end
      return true
       end
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_HEALTHLOSS)) then
doPlayerSendTextMessage(cid, 22,"Você tem mais "..exhaustion.get(cid, 23585).." segundos de proteção!")
doSendMagicEffect(getThingPos(cid), 2)
return false
end
return true
end

E no creaturescripts.xml ter:

<event type="login" name="Protect" event="script" value="protect.lua"/>     
<event type="statschange" name="Protection" event="script" value="protect.lua"/>  
 

 

perfeito *-* muito obrigado :D REP REP REP 

Postado
  • Autor

está apresentando alguns erros aindas, mais está funcionando normalmente;

 

[1:37:18.017] [Error - CreatureScript Interface] 
[1:37:18.017] data/creaturescripts/scripts/protect.lua:onStatsChange
[1:37:18.017] Description: 
[1:37:18.017] data/lib/034-exhaustion.lua:4: attempt to compare number with string
[1:37:18.017] stack traceback:
[1:37:18.017]   data/lib/034-exhaustion.lua:4: in function 'check'
[1:37:18.017]   data/creaturescripts/scripts/protect.lua:14: in function <data/creaturescripts/scripts/protect.lua:13>

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