Advertisement
Guest User

Laurea

a guest
Jun 25th, 2010
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. TimeWalk = {}
  2. TimeWalk_V = {}
  3. TimeWalk_P = {}
  4. local Spell = 111
  5.  
  6. function TimeWalk.MainScript(event, player, spellid)
  7.     if (spellid == Spell) then
  8.         if player:HasAura(Spell) then
  9.             -- do nothing
  10.         else
  11.             TimeWalk_V[player:GetName()] = {}
  12.             TimeWalk_V[player:GetName()].map = player:GetMapId()
  13.             TimeWalk_V[player:GetName()].x = player:GetX()
  14.             TimeWalk_V[player:GetName()].y = player:GetY()
  15.             TimeWalk_V[player:GetName()].z = player:GetZ()
  16.             TimeWalk_V[player:GetName()].o = player:GetO()
  17.             TimeWalk_P[player:GetName()] = {}
  18.             TimeWalk_P[player:GetName()].hp = player:GetHealth()
  19.             TimeWalk_P[player:GetName()].mana = player:GetMana()
  20.             RegisterTimedEvent("TimeWalk.TeleportVisual", 10000, 1, player)
  21.         end
  22.     end
  23. end
  24.  
  25. function TimeWalk.TeleportVisual(player, Event)
  26.     if player:HasAura(Spell) then
  27.         player:CastSpell(50805)
  28.         RegisterTimedEvent("TimeWalk.Teleport", 300, 1, player)
  29.     end
  30. end
  31.  
  32. function TimeWalk.Teleport(player, Event)
  33.     if player:HasAura(Spell) then
  34.         player:Teleport(TimeWalk_V[player:GetName()].map, TimeWalk_V[player:GetName()].x, TimeWalk_V[player:GetName()].y, TimeWalk_V[player:GetName()].z)
  35.         player:SetFacing(TimeWalk_V[player:GetName()].o)
  36.         player:SetHealth(TimeWalk_P[player:GetName()].hp)
  37.         player:SetMana(TimeWalk_P[player:GetName()].mana)
  38.     end
  39. end
  40.  
  41. RegisterServerHook(10, "TimeWalk.MainScript")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement