Code:
function onKill(player, target, lastHit)
if player:isPlayer() == true then
if player:getStorageValue(factionStorage) == target:getStorageValue(factionStorage) then
if target:getSkullType() >= 3 then
player:setStorageValue(honorStorage, player:getStorageValue(honorStorage)-5)
if player:getStorageValue(honorStorage) <= 499 then
player:doSetSkullType(4)
end
elseif target:getSkullType() == 0 then
player:setStorageValue(honorStorage, player:getStorageValue(honorStorage)-10)
if player:getStorageValue(honorStorage) <= 499 then
player:doSetSkullType(4)
end
else
return true
end
else
if target:getLevel() > player:getLevel() then
player:setStorageValue(honorStorage, player:getStorageValue(honorStorage)+2)
if player:getStorageValue(honorStorage) >= 500 then
player:doSetSkullType(0)
end
elseif target:getLevel() <= player:getLevel() then
player:setStorageValue(honorStorage, player:getStorageValue(honorStorage)+1)
if player:getStorageValue(honorStorage) >= 500 then
player:doSetSkullType(0)
end
end
end
end
return true
end