Code:
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 ~= player) then
if(Game.convertIpToString(attackPlayer:getIp()) ~= Game.convertIpToString(player:getIp())) then
if(attackPlayer:getLevel() >= player:getLevel()) then
if(attackPlayer:getLevel() >= player:getLevel()) then
player:addExperience(math.floor(((player:getExperience() / 100) * 6.0)), true)
end
player:say("Frag!", TALKTYPE_MONSTER_SAY)
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You didn't get frag/reward because of killing a player with same ip.")
end
end
end
end
end
I am trying to adapt this code to when 3 players hita a player he receives the damage of only 1