adrianoswatt

onDeath - Mata Monstro Abre TP

Sep 10th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. local function removeTeleport(pos, id)
  2. local item = getTileItemById(pos, id)
  3.     if item.uid > 0 then
  4.         doRemoveItem(item.uid)
  5.         doSendMagicEffect(pos, CONST_ME_POFF)
  6.     end
  7. return true
  8. end
  9.  
  10. function onDeath(cid, corpse, killer)
  11.     local in_pos = {x = 2027, y =1035, z = 7}
  12.     local to_pos = {x = 2087, y = 1033, z = 7}
  13.     local time_to_pass = 30 -- in seconds
  14.     local tpID = 5023    
  15.     if isMonster(cid) then
  16.         if getCreatureName(cid):lower() == 'devovorga' then
  17.             doCreateTeleport(tpID, to_pos, in_pos)
  18.             doSendMagicEffect(in_pos, CONST_ME_TELEPORT)
  19.             doCreatureSay(cid, "You have "..time_to_pass.." seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
  20.             addEvent(removeTeleport, (1000*time_to_pass), in_pos, tpID)
  21.         end
  22.     end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment