Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. local storage = 171994 -- storage
  2. local item = 12696 -- id do item
  3. local time = 5 -- tempo em segundos que o item vai ficar na posição.
  4.  
  5. local pos = {}
  6.  
  7. function lost(cid)
  8. local waittime = 60.0 -- Tempo de exhaustion
  9. local storage = 115820
  10. if exhaustion.check(cid, storage) then
  11. return false
  12. end
  13. if isPlayer(cid) then
  14. for index, pid in pairs(pos) do
  15. if index == getCreatureName(cid) then
  16. local t = getTileItemById(pos[index], item)
  17. if t.uid > 0 then
  18. doRemoveItem(t.uid)
  19. end
  20. end
  21. end
  22. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "O selo foi perdido!")
  23. end
  24. end
  25.  
  26. function onCastSpell(cid, var)
  27.  
  28. if getPlayerStorageValue(cid, storage) - os.time() <= 0 then
  29. pos[getCreatureName(cid)] = getCreaturePosition(cid)
  30. setPlayerStorageValue(cid, storage, os.time()+time)
  31. doCreateItem(item, getCreaturePosition(cid))
  32. exhaustion.set(cid, storage, waittime)
  33. doSendMagicEffect(getCreaturePosition(cid), 3)
  34. addEvent(lost, time*1000, cid)
  35. elseif getPlayerStorageValue (cid, storage) - os.time() >= 1 then
  36. for index, pid in pairs(pos) do
  37. if index == getCreatureName(cid) then
  38. doTeleportThing(cid, pid)
  39. end
  40. end
  41. end
  42.  
  43. return true
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement