Ir para conteúdo

Featured Replies

Postado

tenho um script de pvp enforced , porem ele da a exp pra todos os players que participaram da kill, alguem sabe colocar pra somente o ultimo player que deu o ultimo hit receber? (tipo o que fragou a kill)

script:

Spoiler

 

function onKill(cid, target, lastHit)
local storage = getPlayerStorageValue(target, 2310)
    if getPlayerLevel(cid) <= getPlayerLevel(target) and isPlayer(cid) and isPlayer(target) then
            doSendAnimatedText(getPlayerPosition(cid), "5000000", 215)
            doPlayerAddExperience(cid, (getPlayerExperience(target) / 500))
elseif getPlayerLevel(cid) > getPlayerLevel(target) and isPlayer(cid) and isPlayer(target) then
            doSendAnimatedText(getPlayerPosition(cid), "5000000", 215)
            doPlayerAddExperience(cid, (getPlayerExperience(target) / 5000))
        return true
    end
return true
end


 

 

Resolvido por Sun

Ir para solução
  • Respostas 18
  • Visualizações 1.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @LeoTKessa eu nao sei, é com vc

  • @poko360 Muda de onKill para onDeath o xml   function onDeath(cid, corpse, killer) local storage = getPlayerStorageValue(cid, 2310) if getPlayerLevel(cid) <= getPlayerLevel(cid) and isP

  • pode deixar onKill e registrar no player pelo onlogin, ai vc usa o codigo assim:   function onKill(cid, target, lastHit) if lastHit and isPlayer(target) then local calc = getPlayerLevel(ci

Posted Images

Postado

@poko360
Muda de onKill para onDeath o xml

 

function onDeath(cid, corpse, killer)
local storage = getPlayerStorageValue(cid, 2310)
    if getPlayerLevel(cid) <= getPlayerLevel(cid) and isPlayer(killer[1]) and isPlayer(cid) then
            doSendAnimatedText(getPlayerPosition(cid), "5000000", 215)
            doPlayerAddExperience(killer[1], (getPlayerExperience(cid) / 500))     
elseif getPlayerLevel(cid) > getPlayerLevel(cid) and isPlayer(killer[1]) and isPlayer(cid) then
            doSendAnimatedText(getPlayerPosition(cid), "5000000", 215)
            doPlayerAddExperience(killer[1], (getPlayerExperience(cid) / 5000))
        return true
    end
return true
end

 

Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas.

discord.gg/phJZeHa2k4

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

Postado
  • Autor

@LeoTK
ja tentei fazer isso antes, mas nada acontece
tentei agr tambem com esse script, nao funfou =C

dei uma atualizada no script, removi uma linha q tava dando bug
dai testei assim:

Spoiler

function onDeath(cid, corpse, deathList)
local storage = getPlayerStorageValue(target, 2310)
    if  isPlayer(deathList[1]) and isPlayer(target) then
            doSendAnimatedText(getPlayerPosition(cid), "5000000", 215)
            doPlayerAddExperience(deathList[1], (getPlayerExperience(target) / 500))     
return true
end

vc sabe dizer se ta faltando algo?

 

edit: 
parece que a função OnDeath não reconhece "isPlayer(target)" , vc tem alguma ideia de como posso fazer?

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

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