Neptera
Member
- Joined
- Mar 3, 2018
- Messages
- 71
- Reaction score
- 17
How can I make this lua script give one kill to each player in a party and not just to the killer?
Lua:
function onKill(player, target)
local monster = config[target:getName():lower()]
if not monster or target:getMaster() then
return true
end
local storageValue = player:getStorageValue(monster.storage)
if storageValue >= monster.start then
if storageValue >= monster.count then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have already killed " .. monster.count .. " " .. monster.plural .. ". report the task to any npc post office.")
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have killed [" .. storageValue .. "/" .. monster.count .. "] " .. monster.plural .. ".")
end
player:setStorageValue(monster.storage, storageValue + 1)
end
return true
end