[Lua] Teleport on contact instead of use menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    freeride474's Avatar Contributor
    Reputation
    127
    Join Date
    Aug 2006
    Posts
    278
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Teleport on contact instead of use

    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.

    [Lua] Teleport on contact instead of use
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    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")

  3. #3
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please tag your threads in the future.

  4. #4
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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")

Similar Threads

  1. [Problem] Blua? LUA? Teleporter problem
    By lilbdiablo12 in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 10-27-2008, 11:48 AM
  2. <Request> Lua Teleporter
    By sinofevil in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 10-07-2008, 05:45 PM
  3. [Lua] Teleport/Warp Item?
    By Pretzal in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 09-29-2008, 09:17 PM
  4. Help with lua teleporter
    By Arugos in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 09-17-2008, 09:09 AM
  5. [LUA] Teleport on spell use
    By Eponyx in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 05-24-2008, 10:10 AM
All times are GMT -5. The time now is 09:55 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search