[LUA] Help with Teleporter. menu

User Tag List

Results 1 to 8 of 8
  1. #1
    iRyuzaki's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] Help with Teleporter.

    Well, Hi.

    I've got a problem with my custom Teleporter. In-game, when you right click the NPC nothing happens. There are no errors in the worldserver.exe.

    Code:
    function WarpNPC_OnGossipTalk(pUnit, event, player, pMisc)  
    function WarpNPC_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc) 	 
    
    pUnit:GossipMenuAddItem(3, "Leveling Road", 1, 0)
    pUnit:GossipMenuAddItem(3, "Shopping Center", 2, 0)
    pUnit:GossipMenuAddItem(3, "Custom City (Laggy)", 3, 0)
    local race=player:GetPlayerRace()
    if race==1 or race==3 or race==4 or race==7 or race==11 then
    pUnit:GossipMenuAddItem(3, "Alliance Cities", 4, 0)
    end
    local race=player:GetPlayerRace()
    if race==2 or race==5 or race==6 or race==8 or race==10 then
    pUnit:GossipMenuAddItem(3, "Horde Cities", 5, 0)
    end
    pUnit:GossipMenuAddItem(3, "Shattrath City", 6, 0)
    end
    end
    
    if(intid ==1 ) then --Leveling Road
    player:Teleport(1, 5458.404297, -3736.599609, 1593.439941)
    pUnit:GossipComplete(player)
    end
    if(intid == 2) then --Mall
    player:Teleport(0, 3488.580078, -3380.110107, 135.30299)
    pUnit:GossipComplete(player)
    end
    if(intid == 3) then --Custom City
    player:Teleport(1, -3738.399902,-692.807983, 177.082993)
    pUnit:GossipComplete(player)
    end
    if(intid == 3) then --Shattrath
    player:Teleport(530, -1884.236572, 5416.575195, -12.427720)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 4) then
    pUnit:GossipCreateMenu(99, player, 0)
    pUnit:GossipMenuAddItem(1, "Stormwind", 7, 0)
    pUnit:GossipMenuAddItem(1, "Darnassus", 8, 0)
    pUnit:GossipMenuAddItem(1, "Exodar", 9, 0)
    pUnit:GossipMenuAddItem(1, "Ironforge", 10, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if(intid == 1) then
    pUnit:GossipCreateMenu(99, player, 0)
    pUnit:GossipMenuAddItem(1, "Undercity", 11, 0)
    pUnit:GossipMenuAddItem(1, "Thunderbluff", 12, 0)
    pUnit:GossipMenuAddItem(1, "Orgrimmar", 13, 0)
    pUnit:GossipMenuAddItem(1, "Silvermoon", 14, 0)
    pUnit:GossipSendMenu(player)
    end
    
    
    if(intid == 7) then --Stormwind
    player:Teleport(0, -8913.23, 554.633, 94.7944)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 8) then --Darnassus
    player:Teleport(1,9933.695313, 2494.189941, 1317.823364)
    pUnit:GossipComplete(player)
    end
    
    if(intid ==9) then --Exodar
    player:Teleport(530, -3868.061768, -11735.048828, -107.270622)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 10) then --Ironforge
    player:Teleport(0, -4919.837891, -956.297607, 501.505859)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 11) then --Undercity
    player:Teleport(0, 1564.626343, 240.506042, -43.539196)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 12) then --Thunderbluff
    player:Teleport(1, -1203.377075, -41.101578, 161.549530)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 13) then --Orgrimmar
    player:Teleport(1, 1515.337158, -4413.781738, 17.393652)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 14) then --Silvermoon
    player:Teleport(530, 9888.708008, -7179.152832, 31.032106)
    pUnit:GossipComplete(player)
    end
    
    RegisterUnitGossipEvent(50099, 1, "WarpNPC_OnGossipTalk")
    RegisterUnitGossipEvent(50099, 2, "WarpNPC_OnGossipSelect")
    Thanks,

    <3 Ryuzaki.

    [LUA] Help with Teleporter.
  2. #2
    thetrueman2's Avatar Active Member
    Reputation
    16
    Join Date
    Nov 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems like you dont have the NPC flags set right.. try changing the NPCflags in the creature_proto table to 1 (gossip) and then restart the server:]

  3. #3
    catl2wow's Avatar Member
    Reputation
    4
    Join Date
    Nov 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function WarpNPC_OnGossipTalk(pUnit, event, player, pMisc)  
    
    pUnit:GossipCreateMenu(99, player, 0)
    pUnit:GossipMenuAddItem(3, "Leveling Road", 1, 0)
    pUnit:GossipMenuAddItem(3, "Shopping Center", 2, 0)
    pUnit:GossipMenuAddItem(3, "Custom City (Laggy)", 3, 0)
    local race=player:GetPlayerRace()
    if race==1 or race==3 or race==4 or race==7 or race==11 then
    pUnit:GossipMenuAddItem(3, "Alliance Cities", 4, 0)
    end
    local race=player:GetPlayerRace()
    if race==2 or race==5 or race==6 or race==8 or race==10 then
    pUnit:GossipMenuAddItem(3, "Horde Cities", 5, 0)
    end
    pUnit:GossipMenuAddItem(3, "Shattrath City", 6, 0)
    end
    
    function WarpNPC_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)      
    if(intid ==1 ) then --Leveling Road
    player:Teleport(1, 5458.404297, -3736.599609, 1593.439941)
    pUnit:GossipComplete(player)
    end
    if(intid == 2) then --Mall
    player:Teleport(0, 3488.580078, -3380.110107, 135.30299)
    pUnit:GossipComplete(player)
    end
    if(intid == 3) then --Custom City
    player:Teleport(1, -3738.399902,-692.807983, 177.082993)
    pUnit:GossipComplete(player)
    end
    if(intid == 3) then --Shattrath
    player:Teleport(530, -1884.236572, 5416.575195, -12.427720)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 4) then
    pUnit:GossipCreateMenu(99, player, 0)
    pUnit:GossipMenuAddItem(1, "Stormwind", 7, 0)
    pUnit:GossipMenuAddItem(1, "Darnassus", 8, 0)
    pUnit:GossipMenuAddItem(1, "Exodar", 9, 0)
    pUnit:GossipMenuAddItem(1, "Ironforge", 10, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if(intid == 1) then
    pUnit:GossipCreateMenu(99, player, 0)
    pUnit:GossipMenuAddItem(1, "Undercity", 11, 0)
    pUnit:GossipMenuAddItem(1, "Thunderbluff", 12, 0)
    pUnit:GossipMenuAddItem(1, "Orgrimmar", 13, 0)
    pUnit:GossipMenuAddItem(1, "Silvermoon", 14, 0)
    pUnit:GossipSendMenu(player)
    end
    
    
    if(intid == 7) then --Stormwind
    player:Teleport(0, -8913.23, 554.633, 94.7944)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 8) then --Darnassus
    player:Teleport(1,9933.695313, 2494.189941, 1317.823364)
    pUnit:GossipComplete(player)
    end
    
    if(intid ==9) then --Exodar
    player:Teleport(530, -3868.061768, -11735.048828, -107.270622)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 10) then --Ironforge
    player:Teleport(0, -4919.837891, -956.297607, 501.505859)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 11) then --Undercity
    player:Teleport(0, 1564.626343, 240.506042, -43.539196)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 12) then --Thunderbluff
    player:Teleport(1, -1203.377075, -41.101578, 161.549530)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 13) then --Orgrimmar
    player:Teleport(1, 1515.337158, -4413.781738, 17.393652)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 14) then --Silvermoon
    player:Teleport(530, 9888.708008, -7179.152832, 31.032106)
    pUnit:GossipComplete(player)
    end
    end
    
    RegisterUnitGossipEvent(50099, 1, "WarpNPC_OnGossipTalk")
    RegisterUnitGossipEvent(50099, 2, "WarpNPC_OnGossipSelect")
    Try this

  4. #4
    iRyuzaki's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @catl2wow, No. Tried still not working.

    @ Thetrueman2, In creature_proto, the NPC_flags are already at 1, and in creature_names they're 7.

    Also, it's a problem with the LUA script. The previous script worked, but I wanted to add/remove some ports and now it doesn't work.
    Last edited by iRyuzaki; 05-21-2009 at 04:58 AM.

  5. #5
    iRyuzaki's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bump? I need to fix this problem.

  6. #6
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function WarpNPC_OnGossipTalk(pUnit, event, player, pMisc)  
    
    pUnit:GossipCreateMenu(99, player, 0)
    pUnit:GossipMenuAddItem(3, "Leveling Road", 1, 0)
    pUnit:GossipMenuAddItem(3, "Shopping Center", 2, 0)
    pUnit:GossipMenuAddItem(3, "Custom City (Laggy)", 3, 0)
    local race=player:GetPlayerRace()
    if race==1 or race==3 or race==4 or race==7 or race==11 then
    pUnit:GossipMenuAddItem(3, "Alliance Cities", 4, 0)
    end
    local race=player:GetPlayerRace()
    if race==2 or race==5 or race==6 or race==8 or race==10 then
    pUnit:GossipMenuAddItem(3, "Horde Cities", 5, 0)
    end
    pUnit:GossipMenuAddItem(3, "Shattrath City", 6, 0)
    pUnit:GossipSendMenu(player)
    end
    
    function WarpNPC_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)      
    if(intid ==1 ) then --Leveling Road
    player:Teleport(1, 5458.404297, -3736.599609, 1593.439941)
    pUnit:GossipComplete(player)
    end
    if(intid == 2) then --Mall
    player:Teleport(0, 3488.580078, -3380.110107, 135.30299)
    pUnit:GossipComplete(player)
    end
    if(intid == 3) then --Custom City
    player:Teleport(1, -3738.399902,-692.807983, 177.082993)
    pUnit:GossipComplete(player)
    end
    if(intid == 3) then --Shattrath
    player:Teleport(530, -1884.236572, 5416.575195, -12.427720)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 4) then
    pUnit:GossipCreateMenu(99, player, 0)
    pUnit:GossipMenuAddItem(1, "Stormwind", 7, 0)
    pUnit:GossipMenuAddItem(1, "Darnassus", 8, 0)
    pUnit:GossipMenuAddItem(1, "Exodar", 9, 0)
    pUnit:GossipMenuAddItem(1, "Ironforge", 10, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if(intid == 1) then
    pUnit:GossipCreateMenu(99, player, 0)
    pUnit:GossipMenuAddItem(1, "Undercity", 11, 0)
    pUnit:GossipMenuAddItem(1, "Thunderbluff", 12, 0)
    pUnit:GossipMenuAddItem(1, "Orgrimmar", 13, 0)
    pUnit:GossipMenuAddItem(1, "Silvermoon", 14, 0)
    pUnit:GossipSendMenu(player)
    end
    
    
    if(intid == 7) then --Stormwind
    player:Teleport(0, -8913.23, 554.633, 94.7944)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 8) then --Darnassus
    player:Teleport(1,9933.695313, 2494.189941, 1317.823364)
    pUnit:GossipComplete(player)
    end
    
    if(intid ==9) then --Exodar
    player:Teleport(530, -3868.061768, -11735.048828, -107.270622)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 10) then --Ironforge
    player:Teleport(0, -4919.837891, -956.297607, 501.505859)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 11) then --Undercity
    player:Teleport(0, 1564.626343, 240.506042, -43.539196)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 12) then --Thunderbluff
    player:Teleport(1, -1203.377075, -41.101578, 161.549530)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 13) then --Orgrimmar
    player:Teleport(1, 1515.337158, -4413.781738, 17.393652)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 14) then --Silvermoon
    player:Teleport(530, 9888.708008, -7179.152832, 31.032106)
    pUnit:GossipComplete(player)
    end
    end
    
    RegisterUnitGossipEvent(50099, 1, "WarpNPC_OnGossipTalk")
    RegisterUnitGossipEvent(50099, 2, "WarpNPC_OnGossipSelect")
    Try this. It's catl2wow's script, *but* he forgot to add pUnit:GossipSendMenu(player).

  7. #7
    Donandi's Avatar Member
    Reputation
    15
    Join Date
    Nov 2008
    Posts
    151
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    after inserting a script u have to restart the server =D. try to change the flags in creture_names too.

  8. #8
    Lytle69's Avatar Member
    Reputation
    13
    Join Date
    Aug 2008
    Posts
    66
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok so I have this problem on my server, however the random # you enter when you spawn it, try changing that around. It's not suppose to matter but I've tested and tested and usually after like the 3rd time spawning it, the Teleporter works with no bugs at all. I dunno if it's from a leak soemwhere or what.

Similar Threads

  1. [Lua] Help with script - RemoveEvents() bugged
    By gospag in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 04-09-2010, 12:07 PM
  2. [Lua] Issue with Teleporter
    By trujillo in forum WoW EMU Questions & Requests
    Replies: 19
    Last Post: 03-08-2010, 07:53 PM
  3. [Lua] Help with Gossip?
    By Beasthuntah in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 06-02-2009, 03:52 PM
  4. [Lua] - Problem With Teleporter
    By shadowslayer133 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 09-16-2008, 04:02 PM
  5. [Help] i need Lua help with this script...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 25
    Last Post: 03-03-2008, 03:45 PM
All times are GMT -5. The time now is 02:28 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