president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
Hi my dear friends.
I'm currently trying trying to print the player who did most Damage on monsters x,y. I don't think that I'm using it right.
Thanks.
I'm currently trying trying to print the player who did most Damage on monsters x,y. I don't think that I'm using it right.
Code:
local names = {'x', 'y'}
function onDeath(creature, corpse, lastHitKiller, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
local monster = target:getMonster()
if not monster then
return true
end
if not (isInArray(names, monster:getName():lower())) then
return true
end
local damageMap = monster:getDamageMap()
for id, damage in pairs(damageMap) do
local player = Player(id)
if player then
print(player:getName())
end
end
return true
end
Thanks.
Last edited: