Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onKill(cid, target, lastHit)
- local started = getPlayerStartedTasks(cid)
- if isPlayer(target) then
- return true
- end
- if started and #started > 0 then
- for _, id in ipairs(started) do
- if isInArray(tasks[id].creatures, getCreatureName(target):lower()) then
- if getPlayerStorageValue(cid, KILLSSTORAGE_BASE + id) < 0 then
- setPlayerStorageValue(cid, KILLSSTORAGE_BASE + id, 0)
- end
- local boolean = isPartySharedExperienceActive(cid)
- if setPartySharedExperience(cid, boolean) or getPlayerStorageValue(cid, KILLSSTORAGE_BASE + id) < tasks[id].killsRequired then
- setPlayerStorageValue(cid, KILLSSTORAGE_BASE + id, getPlayerStorageValue(cid, KILLSSTORAGE_BASE + id) + 1)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have killed '..getPlayerStorageValue(cid, KILLSSTORAGE_BASE + id).. "/" .. tasks[id].killsRequired .. " of " .. tasks[id].raceName .. " task.")
- end
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement