[Teleporter] LUA code! menu

User Tag List

Results 1 to 14 of 14
  1. #1
    lilbdiablo12's Avatar Active Member
    Reputation
    40
    Join Date
    Feb 2008
    Posts
    535
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Teleporter] LUA code!

    Ok i have SEEN plenty of people get other LUA scripts to not work, this one is a little more simple and easier to Edit.

    Open up notepad and under paste this in there

    Code:
    local npcid = 200000
    local menunum = 33310
    local menuicon = 4
    local teleicon = 2
    local menu =
    {
        {"Alliance Locations",
            {
                {"Stormwind", 0, -9077.296875, 423.434479, 92.79048},
                {"Ironforge", 0, -4989.347168, -872.971741, 496.984375},
                {"Darnassus", 1, 9951.940430, 2280.126953, 1341.395386},
                {"Exodar", 530, -4010.619141, -11886.310547, -1.610816},
                
            }
        },
        
        {"Horde Locations",
            {
                {"Orgrimmar", 1, 1502.709961, -4415.419922, 21.552349},
                {"Undercity", 0, 1642.265381, 239.750000, 62.592251},
                {"Thunder Bluff", 1, -1289.020020, 144.417999, 129.876007},
                {"Silvermoon", 530, 9394.371094, -7278.359375, 14.239411},
            }
         },
         {"Mall", 1, -11792.368164, -4742.708008, 3.411385},
         {"PvP Area", 0, -13248.059570, 189.193329, 31.204947}
    
    }
    				
    function TeleNPC_MainMenu(Unit, Player)
    	local i = 0
    	Unit:GossipCreateMenu(menunum, Player, 0)
    	for k,v in pairs(menu) do
    		i = i + 1
    		if type(v[2]) == "table" then
    			Unit:GossipMenuAddItem(menuicon, v[1], i, 0)
    			i = i + #(v[2])
    		else
    			Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    		end
    	end
    	Unit:GossipSendMenu(Player)
    end
    
    function TeleNPC_SubMenu(Unit, Player, i, Submenu)
    	Unit:GossipCreateMenu(menunum-i, Player, 0)
    	Unit:GossipMenuAddItem(7, "<--Back", 0, 0)
    	for k,v in pairs(Submenu) do
    		i = i + 1
    		Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    	end
    	Unit:GossipSendMenu(Player)
    end
    
    function TeleNPC_OnGossipTalk(Unit, Event, Player)
    	TeleNPC_MainMenu(Unit, Player)
    end
    
    function TeleNPC_OnGossipSelect(Unit, Event, Player, MenuId, Id, Code)
    	local i = 0
    	if(Id == 0) then
    		TeleNPC_MainMenu(Unit,Player)
    	else
    		for k,v in pairs(menu) do
    			i = i + 1
    			if (Id == i) then
    				if type(v[2]) == "table" then
    					TeleNPC_SubMenu(Unit, Player, i, v[2])
    				else
    					if Player:IsInCombat() then
    						Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    					else
    						Player:Teleport(v[2], v[3], v[4], v[5])
    					end
    					Unit:GossipComplete(Player)
    				end
    				return
    			elseif (type(v[2]) == "table") then
    				for j,w in pairs(v[2]) do
    					i = i + 1
    					if (Id == i) then
    						if Player:IsInCombat() then
    							Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    						else
    							Player:Teleport(w[2], w[3], w[4], w[5])
    						end
    						Unit:GossipComplete(Player)
    						return
    					end
    				end
    			end
    		end
    	end
    end
    
    RegisterUnitGossipEvent(200000, 1, "TeleNPC_OnGossipTalk")
    RegisterUnitGossipEvent(200000, 2, "TeleNPC_OnGossipSelect")
    You can of course put your own cords, you can easily put in your own stuff...

    Make sure you make you own NPC

    200000 will be the entry, unless you change it in the script.

    After you have pasted it, save it as a .sql

    make sure notepad is not saving it as a .txt!!!!!!!

    make sure its on All Files before you save it, and just add .lua to it!

    Hope this helps.

    I do not take credit for the whole script, i do not know whos it is, i think its Oxins?

    Hope it works for oyu!
    Last edited by lilbdiablo12; 10-27-2008 at 10:23 PM.

    [Teleporter] LUA code!
  2. #2
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great script! You guys should try it out.
    Last edited by Dr. Livingstone; 10-27-2008 at 10:26 PM.

  3. #3
    lilbdiablo12's Avatar Active Member
    Reputation
    40
    Join Date
    Feb 2008
    Posts
    535
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If i didnt know how to make any of them work, please do tell why the hell i made this one work? ok good bye...

  4. #4
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great script! +Rep! Will work without any special Lua engine.
    Last edited by Dr. Livingstone; 10-27-2008 at 10:36 PM.

  5. #5
    lilbdiablo12's Avatar Active Member
    Reputation
    40
    Join Date
    Feb 2008
    Posts
    535
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, true true, but i also see that alot of it dont work for other people, so ill edit that there

  6. #6
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright. +Rep for a good script

  7. #7
    lilbdiablo12's Avatar Active Member
    Reputation
    40
    Join Date
    Feb 2008
    Posts
    535
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ty

    ~fIlLaR~

  8. #8
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its true. Most of them work, but people seem to be missing the fact that you need to compile a lua engine. (Such as Lua++)

    This is just a basic lua teleporter that will (in theory) work with all emulators (except mangos of course) but it won't have many of the functions and read ability of a Lua++ script.

    So there. Good bye.

    EDIT: Plus.. This is a re-release. But gj on the copy/paste. I'm sure it will be useful to some people.
    NVM about my edit. Need to l2 read

    I live in a shoe

  9. #9
    lilbdiablo12's Avatar Active Member
    Reputation
    40
    Join Date
    Feb 2008
    Posts
    535
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    .... lol? mm okay

  10. #10
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lmao
    I'll give you a +rep for enduring through my rant.

    I live in a shoe

  11. #11
    lilbdiablo12's Avatar Active Member
    Reputation
    40
    Join Date
    Feb 2008
    Posts
    535
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol, alrighty then, Thank you! for enduring a rant of the times!

    BTW, sense you seem to know what you doing for the LUA stuff, can you download my edit of the GM addon. And check the LUA file and make sure its 100% correct, i think it is, but *shrugs* im still learning lol

  12. #12
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First of all post real credits for "template" and second lua can't be part of code and lua script is not code, it is script and just script.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  13. #13
    TheNlghtmare's Avatar Member
    Reputation
    12
    Join Date
    Sep 2008
    Posts
    142
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lilbdiablo12 View Post
    Ok i have SEEN plenty of people get other LUA scripts to not work, this one is a little more simple and easier to Edit.

    Open up notepad and under paste this in there

    Code:
    local npcid = 200000
    local menunum = 33310
    local menuicon = 4
    local teleicon = 2
    local menu =
    {
        {"Alliance Locations",
            {
                {"Stormwind", 0, -9077.296875, 423.434479, 92.79048},
                {"Ironforge", 0, -4989.347168, -872.971741, 496.984375},
                {"Darnassus", 1, 9951.940430, 2280.126953, 1341.395386},
                {"Exodar", 530, -4010.619141, -11886.310547, -1.610816},
                
            }
        },
        
        {"Horde Locations",
            {
                {"Orgrimmar", 1, 1502.709961, -4415.419922, 21.552349},
                {"Undercity", 0, 1642.265381, 239.750000, 62.592251},
                {"Thunder Bluff", 1, -1289.020020, 144.417999, 129.876007},
                {"Silvermoon", 530, 9394.371094, -7278.359375, 14.239411},
            }
         },
         {"Mall", 1, -11792.368164, -4742.708008, 3.411385},
         {"PvP Area", 0, -13248.059570, 189.193329, 31.204947}
    
    }
    				
    function TeleNPC_MainMenu(Unit, Player)
    	local i = 0
    	Unit:GossipCreateMenu(menunum, Player, 0)
    	for k,v in pairs(menu) do
    		i = i + 1
    		if type(v[2]) == "table" then
    			Unit:GossipMenuAddItem(menuicon, v[1], i, 0)
    			i = i + #(v[2])
    		else
    			Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    		end
    	end
    	Unit:GossipSendMenu(Player)
    end
    
    function TeleNPC_SubMenu(Unit, Player, i, Submenu)
    	Unit:GossipCreateMenu(menunum-i, Player, 0)
    	Unit:GossipMenuAddItem(7, "<--Back", 0, 0)
    	for k,v in pairs(Submenu) do
    		i = i + 1
    		Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    	end
    	Unit:GossipSendMenu(Player)
    end
    
    function TeleNPC_OnGossipTalk(Unit, Event, Player)
    	TeleNPC_MainMenu(Unit, Player)
    end
    
    function TeleNPC_OnGossipSelect(Unit, Event, Player, MenuId, Id, Code)
    	local i = 0
    	if(Id == 0) then
    		TeleNPC_MainMenu(Unit,Player)
    	else
    		for k,v in pairs(menu) do
    			i = i + 1
    			if (Id == i) then
    				if type(v[2]) == "table" then
    					TeleNPC_SubMenu(Unit, Player, i, v[2])
    				else
    					if Player:IsInCombat() then
    						Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    					else
    						Player:Teleport(v[2], v[3], v[4], v[5])
    					end
    					Unit:GossipComplete(Player)
    				end
    				return
    			elseif (type(v[2]) == "table") then
    				for j,w in pairs(v[2]) do
    					i = i + 1
    					if (Id == i) then
    						if Player:IsInCombat() then
    							Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    						else
    							Player:Teleport(w[2], w[3], w[4], w[5])
    						end
    						Unit:GossipComplete(Player)
    						return
    					end
    				end
    			end
    		end
    	end
    end
    
    RegisterUnitGossipEvent(200000, 1, "TeleNPC_OnGossipTalk")
    RegisterUnitGossipEvent(200000, 2, "TeleNPC_OnGossipSelect")
    You can of course put your own cords, you can easily put in your own stuff...

    Make sure you make you own NPC

    200000 will be the entry, unless you change it in the script.

    After you have pasted it, save it as a .sql

    make sure notepad is not saving it as a .txt!!!!!!!

    make sure its on All Files before you save it, and just add .lua to it!

    Hope this helps.

    I do not take credit for the whole script, i do not know whos it is, i think its Oxins?

    Hope it works for oyu!

    Is this alliance/horde gossip specific?
    743N1647M@R3 is omgepic dudes and dudettes!

  14. #14
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, if you know to read.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

Similar Threads

  1. Replies: 8
    Last Post: 01-06-2009, 06:08 PM
  2. 25 Hidden Locations Tele's All On 1 NPC!! (LUA CODE)
    By benzkool in forum WoW EMU General Releases
    Replies: 20
    Last Post: 12-11-2008, 01:20 PM
  3. [Lua] Problem with my lua code
    By ariax1 in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 09-26-2008, 02:45 AM
  4. [Lua] Got a problem with my Lua code.
    By sammiboy in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 09-25-2008, 09:04 AM
  5. [Help] Need someone to test a lua code
    By dude891 in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 04-12-2008, 09:59 PM
All times are GMT -5. The time now is 04:50 PM. 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