Advertisement
RoksasNunes

pinto

May 9th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. local config = {
  2.  storage = 16000,
  3.     level = 250,
  4.     firstSqm =
  5.     {
  6.         {x = 247, y = 659, z = 13},
  7.         {x = 247, y = 660, z = 13},
  8.         {x = 247, y = 661, z = 13},
  9.         {x = 247, y = 662, z = 13}
  10.     },
  11.     places =
  12.     {
  13.         {x = 189, y = 650, z = 13},
  14.         {x = 189, y = 651, z = 13},
  15.         {x = 189, y = 652, z = 13},
  16.         {x = 189, y = 653, z = 13},
  17.     }
  18. }
  19.  
  20. function onUse(cid, item, fromPosition, itemEx, toPosition)
  21.  
  22.     local players = {}
  23.     for _, position in ipairs(config.firstSqm) do
  24.         local pid = getTopCreature(position).uid
  25.         if(pid == 0 or not isPlayer(pid) or getPlayerStorageValue(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
  26.             doPlayerSendTextMessage(pid, "The level required is ".. config.level ..", can only perform the quest once, only players can do it, it takes 4 participants.")
  27.             return true
  28.         end
  29.  
  30.         table.insert(players, pid)
  31.     end
  32.  
  33.     for i, pid in ipairs(players) do
  34.         doTeleportThing(pid, config.places[i], false)
  35.         doSendMagicEffect(config.places[i], 14)
  36.     end
  37.  
  38.     doTransformItem(item.uid, item.itemid + 1)
  39.     return true
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement