Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TimeWalk = {}
- TimeWalk_V = {}
- TimeWalk_P = {}
- local Spell = 111
- function TimeWalk.MainScript(event, player, spellid)
- if (spellid == Spell) then
- if player:HasAura(Spell) then
- -- do nothing
- else
- TimeWalk_V[player:GetName()] = {}
- TimeWalk_V[player:GetName()].map = player:GetMapId()
- TimeWalk_V[player:GetName()].x = player:GetX()
- TimeWalk_V[player:GetName()].y = player:GetY()
- TimeWalk_V[player:GetName()].z = player:GetZ()
- TimeWalk_V[player:GetName()].o = player:GetO()
- TimeWalk_P[player:GetName()] = {}
- TimeWalk_P[player:GetName()].hp = player:GetHealth()
- TimeWalk_P[player:GetName()].mana = player:GetMana()
- RegisterTimedEvent("TimeWalk.TeleportVisual", 10000, 1, player)
- end
- end
- end
- function TimeWalk.TeleportVisual(player, Event)
- if player:HasAura(Spell) then
- player:CastSpell(50805)
- RegisterTimedEvent("TimeWalk.Teleport", 300, 1, player)
- end
- end
- function TimeWalk.Teleport(player, Event)
- if player:HasAura(Spell) then
- player:Teleport(TimeWalk_V[player:GetName()].map, TimeWalk_V[player:GetName()].x, TimeWalk_V[player:GetName()].y, TimeWalk_V[player:GetName()].z)
- player:SetFacing(TimeWalk_V[player:GetName()].o)
- player:SetHealth(TimeWalk_P[player:GetName()].hp)
- player:SetMana(TimeWalk_P[player:GetName()].mana)
- end
- end
- RegisterServerHook(10, "TimeWalk.MainScript")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement