Hi,
I'm trying to put in this code some more unsuccessful changes.
I would like to put it for the exp to be divided among everyone and not that everyone gets the same exp
and the player who had a very big level difference does not receive exp
I'm trying to put in this code some more unsuccessful changes.
I would like to put it for the exp to be divided among everyone and not that everyone gets the same exp
and the player who had a very big level difference does not receive exp
Lua:
function onKill(cid, target, lastHit)
local attackPlayer = Player(target)
if not attackPlayer then
return true
end
for id, damage in pairs(attackPlayer:getDamageMap()) do
local player = Player(id)
if player then
if attackPlayer:getTile():hasFlag(TILESTATE_PVPZONE) == false then
local experience = attackPlayer:getExperience()
local expFormula = ((experience / 800) * 1)
player:addExperience(math.floor(expFormula), true)
end
end
end
end