Ir para conteúdo

Featured Replies

Postado

deleta esse script ai que vc tem e a tag dele tbm.

 

ai coloca esse:

 

 

 

 

fulllifepvp.lua

function isInPvpFight(cid)
return getPlayerStorageValue(cid, 887568) - os.time() <= 0 and false or true
end
function onLogin(cid)
	registerCreatureEvent(cid, "InFightAdvance")
	registerCreatureEvent(cid, "InFightCombat")
 	setPlayerStorageValue(cid, 887568, 0)
	return true
end
function onAdvance(cid, skill, oldlevel, newlevel)
  if skill == SKILL__LEVEL and not isInPvpFight(cid) then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
		doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
     end   
return true
end
function onCombat(cid, target)
	if isPlayer(cid) and isPlayer(target) then
	local time = 120 -- 2 minutos que demora pra sair o pvp, modifique ali o tempo
	setPlayerStorageValue(cid, 887568, os.time()+time)
	end
	return true
end

 

TAG

 

<event type="login" name="InFightLogin" event="script" value="fulllifepvp.lua"/>
<event type="advance" name="InFightAdvance" event="script" value="fulllifepvp.lua"/>
<event type="combat" name="InFightCombat" event="script" value="fulllifepvp.lua"/>

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

  • Respostas 16
  • Visualizações 2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado

Aqui no TibiaKing mensagens como UP e BUMP são proibidas, utilize o botão subir este tópico. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

Spoiler

Here in TibiaKing messages like UP and BUMP are prohibited, use the button raise this topic. This is an automated message!
Please read the forum rules.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

  • 2 weeks later...
Postado
  • Autor
Em 28/05/2018 em 21:55, Vodkart disse:

deleta esse script ai que vc tem e a tag dele tbm.

 

ai coloca esse:

 

 

 

 

fulllifepvp.lua


function isInPvpFight(cid)
return getPlayerStorageValue(cid, 887568) - os.time() <= 0 and false or true
end
function onLogin(cid)
	registerCreatureEvent(cid, "InFightAdvance")
	registerCreatureEvent(cid, "InFightCombat")
 	setPlayerStorageValue(cid, 887568, 0)
	return true
end
function onAdvance(cid, skill, oldlevel, newlevel)
  if skill == SKILL__LEVEL and not isInPvpFight(cid) then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
		doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
     end   
return true
end
function onCombat(cid, target)
	if isPlayer(cid) and isPlayer(target) then
	local time = 120 -- 2 minutos que demora pra sair o pvp, modifique ali o tempo
	setPlayerStorageValue(cid, 887568, os.time()+time)
	end
	return true
end

 

TAG

 


<event type="login" name="InFightLogin" event="script" value="fulllifepvp.lua"/>
<event type="advance" name="InFightAdvance" event="script" value="fulllifepvp.lua"/>
<event type="combat" name="InFightCombat" event="script" value="fulllifepvp.lua"/>

 

 

@Vodkart

só tive tempo de testar agora, pois estava com muitas outras tarefas no sv, enfim vod não funcionou, ele não tá healando, se eu removo o and not isInPvpFight(cid) ele funciona normal... (testando sem estar sendo atacado por player)

Postado
function isInPvpFight(cid)
  	if getPlayerStorageValue(cid, 887568) - os.time() <= 0 then
    	return false
   	else
    	return true
	end
end

Tenta alterar a função assim

 

Edit

 

Outra coisa, a storage só está sendo adicionada à pessoa que ataca e não ao atacado, logo inclua a linha no script:

setPlayerStorageValue(target, 887568, os.time()+time)

 

Talvez nem seja necessário alterar a função, uma vez que ela faz exatamente a mesma coisa só escrita de uma forma diferente.

Editado por luiz.marsilio (veja o histórico de edições)

  • 1 year later...

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo