paweleq2000
New Member
- Joined
- Feb 18, 2011
- Messages
- 161
- Reaction score
- 4
Hello, I want to make in this bellow script message which inform us about how much monster we have killed.
Something like this(but it isn't work):
Lua:
function onKill(player, target)
if target:isPlayer() or target:getMaster() then
return true
end
local targetName, startedTasks, taskId = target:getName():lower(), player:getStartedTasks()
for i = 1, #startedTasks do
taskId = startedTasks[i]
if isInArray(tasks[taskId].creatures, targetName) then
local killAmount = player:getStorageValue(KILLSSTORAGE_BASE + taskId)
if killAmount < tasks[taskId].killsRequired then
player:setStorageValue(KILLSSTORAGE_BASE + taskId, killAmount + 1)
end
end
end
return true
end
Something like this(but it isn't work):
Lua:
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getCreatureStorage(cid, KILLSSTORAGE_BASE + id) .. "/" .. tasks[taskId].killsRequired .. " " .. tasks[taskId].raceName .. " already killed.")
end