Advertisement
Guest User

Untitled

a guest
Aug 4th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.92 KB | None | 0 0
  1. local key = 125
  2.  
  3. function onKill(cid, target, damage, flags)
  4.     if isMonster(target) and getPlayerLevel(cid) >= 400 and getCreatureMaxHealth(target) >= 500 and getCreatureMaster(target) == target and getCreatureStorage(cid, 126) == -1 then
  5.         local n = math.max(0, getCreatureStorage(cid, key)) + 1
  6.         doCreatureSetStorage(cid, key, n)
  7.         if n >= 800 then
  8.             local add, a, b, r = math.random(2) == 1
  9.             if add then
  10.                 a, b = math.random(20), math.random(20)
  11.             else
  12.                 a = math.random(5, 25)
  13.                 b = math.random(a-1)
  14.             end
  15.             doCreatureSay(cid, "Please answer this question within 10 minutes to avoid being died: " .. a .. (add and "+" or "-") .. b .. " = ?\nExample 1+1: !answer 2", TALKTYPE_ORANGE_1, false, cid)
  16.             doCreatureSetStorage(cid, 126, ',' .. a .. (add and "+" or "-") .. b)
  17.             doCreatureSetStorage(cid, 127, add and a+b or a-b)
  18.             doCreatureSetStorage(cid, 128, os.time() + 600)
  19.         end
  20.     end
  21.     return true
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement