roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,210
- Solutions
- 35
- Reaction score
- 206
Hi, this scripts task, if 2 player kill a rat.
The count will add only in one player. How can i add a task count for all players that attacked a monter?
tfs 1.3 8.6
The count will add only in one player. How can i add a task count for all players that attacked a monter?
tfs 1.3 8.6
LUA:
function onKill(player, target)
if target:isPlayer() or target:getMaster() then
return true
end
local mon_name = target:getName():lower()
local ret_t = getTaskInfos(player)
if ret_t then
if mon_name == ret_t.name:lower() then
local sto_value = player:getStorageValue(ret_t.storage)
if sto_value < ret_t.amount then
sto_value = sto_value + 1
player:setStorageValue(ret_t.storage, sto_value)
if sto_value < ret_t.amount then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[Task System] Killed ['..(sto_value)..'/'..ret_t.amount..'] '..mon_name..'.')
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[Task System] Killed You finished your task.')
end
end
end
end