darkmu
Well-Known Member
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