Hello guys, I am wondering if it is possible to create a portal that teleports players on contact rather than on use? If someone can show me how it would be greatly appreciated and +Repx4
Thanks,
Superfly
Hello guys, I am wondering if it is possible to create a portal that teleports players on contact rather than on use? If someone can show me how it would be greatly appreciated and +Repx4
Thanks,
Superfly
Last edited by P1raten; 04-12-2010 at 02:14 PM.
Have a invisible npc spawned on the gameobject that gets closest player, if the player is within X amount of yards then teleport them to the place, otherwise do nothing.
Example script:
Code:function Portal_A_Define_Spawn(pUnit, Event) pUnit:RegisterEvent("Lets_Get_Ready_YOERUSOJ", 1000, 1) end function Lets_Get_Ready_YOERUSOJ(pUnit, Event) pUnit:RegisterEvent("We_Need_To_check_For_players_If_there_Are_teleport", 1000, 0) end function We_Need_To_check_For_players_If_there_Are_teleport(pUnit, Event) local player = pUnit:GetClosestPlayer() if player == nil then else if pUnit:GetDistance(player) < 3 then player:Teleport(571, 7496, 2599, 548) else end end end RegisterUnitEvent(2739310, 18, "Portal_A_Define_Spawn")
Please tag your threads in the future.![]()
Alternativly you could use something like this.
Code:local NPC_Entry = 90055 -- Your Invisible Trigger NPC ID local Inrange_Distance = 3 -- Edit to your Desired Distance in Yards. function Trigger_Tele_NPC(unit, event) unit:RegisterEvent("Tele_Trigger", 2000, 0) end function Tele_Trigger(unit, event, player) local plrs = unit:GetInRangePlayers() for k, v in pairs(plrs) do if (unit:GetDistance(v) < Inrange_Distance) then v:Teleport(1, 16042.900391, 1499.63005, 33.5) end end end RegisterUnitEvent(NPC_Entry, 18, "Trigger_Tele_NPC")