Ir para conteúdo

Featured Replies

Postado

Boa noite, tenho um script que da exp ao matar player, como posso configurar a quantidade dessa exp?

é possivel dividir essa exp entre todos os player que atacaram o mesmo jogador?

 

function onKill(cid, target, lastHit)

  if(isPlayer(cid) and isPlayer(target)) then
    if getPlayerIp(cid) ~= getPlayerIp(target) then
      doPlayerAddExperience(cid, (getPlayerExperience(target))) -- you will likely want to introduce a formula here
      else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You will not receive anything for killing players of the same IP.")
    end
  end

return true
end

tfs 0.4 3777

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

Fanobet_3.jpg

Postado
function onKill(cid, target, lastHit)
local EXP = 100 -- experience que o player vai receber, somada a experience do target
  if(isPlayer(cid) and isPlayer(target)) then
    if getPlayerIp(cid) ~= getPlayerIp(target) then
      doPlayerAddExperience(cid, (getPlayerExperience(target)+EXP)) -- you will likely want to introduce a formula here
      else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You will not receive anything for killing players of the same IP.")
    end
  end

return true
end

 

Postado
Spoiler

tabela = {
	config = "no", -- # irá ganhar level ao matar? se sim coloque yes ## --
	quantidade = 2 -- ## level caso você tenha colocado em yes ## --
}

function onKill(cid, target, lastHit)

  if isPlayer(target) then
   if getPlayerIp(cid) ~= getPlayerIp(target) then
		if ( tabela.config == "no" ) then
			doPlayerAddExperience(cid, (getPlayerExperience(target) / 5))
			doSendAnimatedText(getPlayerPosition(cid), "+EXP" ..(getPlayerExperience(target) / 5) , COLOR_RED)
		else
			doPlayerAddSkill(cid, 8, tabela.quantidade)
			doSendAnimatedText(getPlayerPosition(cid), "+LVL " ..tabela.quantidade, COLOR_RED)
			end
		else
	   doPlayerSendCancel(cid, "You will not receive anything for killing players of the same IP.")
	  end
    end
return true
end

 

@Lost666

 

você pode deixar tanto para receber em level, quanto em XP, lembrando que ele irá receber a exp do target DIVIDIDO por 5 e irá aparecer um texto animado no jogador contendo essa quantia de exp ganha!

 

já caso você queira apenas deixar ganhando level, ele irá aparecer um texto animado no jogador contendo a quantia de level ganho!

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

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

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