Advertisement
Kaiquegabriel

Untitled

Jul 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. function onDeath(cid, killer)
  2. local pos = {x = 33165, y = 31710, z = 14}
  3. local toPos = {x = 33164, y = 31710, z = 14}
  4. local tempo = 180
  5. local teleportID = 1387
  6. local storage = 18291
  7. local message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear."
  8.  
  9. if getGlobalStorageValue(storage) == -1 then
  10. setGlobalStorageValue(storage, getGlobalStorageValue(storage)+1)
  11. elseif getGlobalStorageValue(storage) == 0 then
  12. doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
  13. doCreateTeleport(teleportID, toPos, pos)
  14. setGlobalStorageValue(storage, -1)
  15. addEvent(removeTeleport, tempo*1000, pos, teleportID)
  16. end
  17. return true
  18. end
  19.  
  20. function removeTeleport(teleport)
  21. local t = getTileItemById(pos, teleportID)
  22. if t then
  23. doRemoveItem(t.uid, 1)
  24. doSendMagicEffect(pos, CONST_ME_POFF)
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement