Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sky = {
- 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}},
- level = {100,200,300,400},
- fight = true,
- days = 2
- }
- function onUse(cid, item, frompos, item2, topos)
- horas = math.floor((getPlayerStorageValue(cid, 7870) - os.time())/(3600))
- minutos = math.floor((getPlayerStorageValue(cid, 7870) - os.time())/(60))
- level = getPlayerLevel(cid)
- if (sky.fight == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
- doPlayerSendTextMessage(cid,22,"Você Precisa estar sem battle para usar o item.")
- return FALSE
- end
- if (level <= sky.level[1] ) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0) then
- doRemoveItem(2177,1)
- doTeleportThing(cid,sky.pos[1])
- doSendMagicEffect(getPlayerPosition(cid), 10)
- doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
- elseif (level <= sky.level[2]) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0) then
- doRemoveItem(2177,1)
- doTeleportThing(cid,sky.pos[2])
- doSendMagicEffect(getPlayerPosition(cid), 10)
- doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
- elseif (level <= sky.level[3]) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0)then
- doRemoveItem(2177,1)
- doTeleportThing(cid,sky.pos[3])
- doSendMagicEffect(getPlayerPosition(cid), 10)
- doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
- elseif (level >= sky.level[4]) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0)then
- doRemoveItem(2177,1)
- doTeleportThing(cid,sky.pos[3])
- doSendMagicEffect(getPlayerPosition(cid), 10)
- doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
- if horas >= 1 then
- doPlayerSendCancel(cid, "Voce nao pode usar a runa "..(minutos < 0 and 0 or minutos).." minutos")
- doPlayerSendTextMessage(cid, 25, "Nao tem level suficiente ou seu level e maior")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment