• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua death count for everyone

darkmu

Well-Known Member
Joined
Aug 26, 2007
Messages
278
Solutions
1
Reaction score
50
Location
Paraná,Brazil
What is happening is that if someone hunts together at a party doing a task it is always counted the last one to kill and not everyone who did some kind of damage, could someone help me as I do this?

LUA:
local config =  _G["riftTasksConfig"]
local storage = 901000

function onKill(player, target, lastHit) 
    if not player:isPlayer() then
        return false
    end
    
    local startedTasks = player:getRiftStartedTasks()
    
    
    for _, taskId in pairs(startedTasks) do
        local teste = config[taskId]   
    
        if(isMonster(target)) then
            if (isInArray(teste.creatures, string.lower(getCreatureName(target)))) then                       
                player:setStorageValue(storage + taskId, player:getStorageValue(storage + taskId) + 1)
            end
        end
    end
    
    return true
end
 
Back
Top