Ir para conteúdo
  • 0

Algo Errado Com Meu Onkill.lua


hadamais

Pergunta

Eis meu OnKill.lua

 

function onKill(cid, target)
--config----------------------------
local lvl = getPlayerLevel(cid) --players level
local nlvl = getPlayerLevel(cid) + 5 -- add 5 levels
--end-------------------------------
   if isPlayer(target) == TRUE then
    if getPlayerIp(cid) ~= getPlayerIp(target) then
				    local exp = (50 * (lvl) * (lvl) * (lvl) - 150 * (lvl) * (lvl) + 400 * (lvl)) / 5
				    local nexp = (50 * (nlvl) * (nlvl) * (nlvl) - 150 * (nlvl) * (nlvl) + 400 * (nlvl)) / 5
				    local newexp = nexp - exp
				    doPlayerAddExp(cid,newexp)
				    doPlayerAddMoney(cid, 20)
  doCreatureSetDropLoot(target, false)
				    doSendAnimatedText(getPlayerPosition(cid), "Orgasmic~", 198)
		    else
	    doPlayerAddExperience(cid, -50000)
	    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
    end
    end
   return TRUE
end

 

 

 

PORQUE NÃO ESTÁ MAIS SUBINDO XP?

 

Obs: Servidor Enforced!

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

testa assim:

 

local function doPlayerAddLevel(cid, levels)
   local currentExp, newLevel = getPlayerExperience(cid), getPlayerLevel(cid) + levels
   local expNeeded = ((50 * newLevel * newLevel * newLevel) - (150 * newLevel * newLevel) + (400 * newLevel)) / 3
   doPlayerAddExperience(cid, expNeeded - currentExp)
end

function onKill(cid, target)
--config----------------------------
local addLevels = 5
--end-------------------------------
   if isPlayer(target) == TRUE then
    if getPlayerIp(cid) ~= getPlayerIp(target) then
	    doPlayerAddLevel(cid, addLevels)
	    doPlayerAddMoney(cid, 20)
	    doCreatureSetDropLoot(target, false)
	    doSendAnimatedText(getPlayerPosition(cid), "Orgasmic~", 198)
    else
	    doPlayerAddExperience(cid, -50000)
	    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
    end
   end
return TRUE
end

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...