i have this script:
but when you kill the player, it will give the exp to the last person to damage the player
.
i want if 3 or 4 person kill someone divide the exp between the number of person who kill him.
PHP:
exp = function(cid)
local s = {--from lvl, to lvl, exp
{49,59,1000000},
{60,79,1300000},
{80,89,2000000},
{90,99,2000000},
{100,109,3500000},
{110,119,7000000},
}
for _, t in ipairs(s) do
if getPlayerLevel(cid) > t[1] and getPlayerLevel(cid) <= t[2] then
return t
end
end
end
function onKill(cid, target, lastHit)
if isPlayer(cid) and isPlayer(target) and lasthit then
if tonumber(exp(cid)[3]) then
doPlayerAddExperience(cid, exp(cid)[3])
end
return true
end
function onLogin(cid)
registerCreatureEvent(cid, 'experiencia')
return true
end
end
i want if 3 or 4 person kill someone divide the exp between the number of person who kill him.