• 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!

RevScripts Task system canary

sebeq12

New Member
Joined
Aug 16, 2022
Messages
6
Reaction score
0
Hi, everyone i have task system but it doesn't count in party kills only last hit.
Lua:
local taskCreature = CreatureEvent("TaskCreature")

function taskCreature.onKill(player, target)
    if target:isPlayer() or target:getMaster() then
        return true
    end

    local targetName = target:getName():lower()
    local data = getTaskByMonsterName(targetName)
    if data ~= false and player:hasStartedTask(data.storage) then
        if player:getStorageValue(10102) >= os.time() then
        player:addTaskKill(data.storage, 2)
        else
        player:addTaskKill(data.storage, 1)
        end
    end
    return true
end

taskCreature:register()

any ideas?
 
Probably better to use onDeath and loop through the damage map creature:getDamageMap(), this way you get all the players that dealt damage to the creature.
 
Back
Top