Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. function onKill(cid, target, lastHit)
  2. local started = getPlayerStartedTasks(cid)
  3.  
  4. if isPlayer(target) then
  5. return true
  6. end
  7.  
  8. if started and #started > 0 then
  9. for _, id in ipairs(started) do
  10. if isInArray(tasks[id].creatures, getCreatureName(target):lower()) then
  11. if getPlayerStorageValue(cid, KILLSSTORAGE_BASE + id) < 0 then
  12. setPlayerStorageValue(cid, KILLSSTORAGE_BASE + id, 0)
  13. end
  14.  
  15. local boolean = isPartySharedExperienceActive(cid)
  16. if setPartySharedExperience(cid, boolean) or getPlayerStorageValue(cid, KILLSSTORAGE_BASE + id) < tasks[id].killsRequired then
  17. setPlayerStorageValue(cid, KILLSSTORAGE_BASE + id, getPlayerStorageValue(cid, KILLSSTORAGE_BASE + id) + 1)
  18. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have killed '..getPlayerStorageValue(cid, KILLSSTORAGE_BASE + id).. "/" .. tasks[id].killsRequired .. " of " .. tasks[id].raceName .. " task.")
  19. end
  20. end
  21. end
  22. end
  23. return true
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement