Skip to content

Instantly share code, notes, and snippets.

@dbjorkholm
Created October 15, 2015 07:32
Show Gist options
  • Save dbjorkholm/bd3d8ff5030cd1c258aa to your computer and use it in GitHub Desktop.
Save dbjorkholm/bd3d8ff5030cd1c258aa to your computer and use it in GitHub Desktop.
test
function onKill(creature, target)
if not target:isMonster or target:getMaster() then
return true
end
local targetName = target:getName():lower()
if targetName ~= 'demon' then
return true
end
for attackerId, damage in pairs(target:getDamageMap()) do
local tmpPlayer = Player(attackerId)
if tmpPlayer then
-- do something
-- e.g tmpPlayer:addItem(2195, 1)
end
end
return true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment