skydangerous

Untitled

Nov 2nd, 2011
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.25 KB | None | 0 0
  1. local sky = {
  2.         pos = {{x = 1009,y = 1025,z=7},{x = 1009,y = 1026,z=7},{x = 1009,y = 1027,z=7},{x = 1009,y = 1028,z=7}},
  3.         level = {100,200,300,400},
  4.         fight = true,
  5.         days = 2
  6. }
  7. function onUse(cid, item, frompos, item2, topos)
  8.         horas = math.floor((getPlayerStorageValue(cid, 7870) - os.time())/(3600))
  9.         minutos = math.floor((getPlayerStorageValue(cid, 7870) - os.time())/(60))
  10. level = getPlayerLevel(cid)
  11.  if (sky.fight == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
  12.                 doPlayerSendTextMessage(cid,22,"Você Precisa estar sem battle para usar o item.")      
  13.                 return FALSE
  14.         end
  15.         if (level <= sky.level[1] ) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0) then
  16.                 doRemoveItem(2177,1)
  17.                 doTeleportThing(cid,sky.pos[1])
  18.                 doSendMagicEffect(getPlayerPosition(cid), 10)
  19.                 doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")    
  20.         elseif (level <= sky.level[2]) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0) then
  21.                 doRemoveItem(2177,1)
  22.                 doTeleportThing(cid,sky.pos[2])
  23.                 doSendMagicEffect(getPlayerPosition(cid), 10)
  24.                 doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
  25.         elseif (level <= sky.level[3]) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0)then
  26.                 doRemoveItem(2177,1)
  27.                 doTeleportThing(cid,sky.pos[3])
  28.                 doSendMagicEffect(getPlayerPosition(cid), 10)
  29.                 doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
  30.          elseif (level >= sky.level[4]) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0)then
  31.                 doRemoveItem(2177,1)
  32.                 doTeleportThing(cid,sky.pos[3])
  33.                 doSendMagicEffect(getPlayerPosition(cid), 10)
  34.                 doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
  35.        
  36.         if horas >= 1 then         
  37.         doPlayerSendCancel(cid, "Voce nao pode usar a runa  "..(minutos < 0 and 0 or minutos).." minutos")
  38.         doPlayerSendTextMessage(cid, 25, "Nao tem level suficiente ou seu level e maior")
  39.         end
  40. end
  41.         end
  42.  
Advertisement
Add Comment
Please, Sign In to add comment