TeleporterNPC.lua not working! menu

User Tag List

Results 1 to 13 of 13
  1. #1
    _DEFiANT's Avatar Member
    Reputation
    44
    Join Date
    Aug 2008
    Posts
    240
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    TeleporterNPC.lua not working!

    Alright, I spent about... 4 hours trying to make a TeleporterNPC with the help of somone from MMowned (I always forget their name.. will edit later with name..) and when I finally added the LUA file to my scripts folder, restarted the server, the NPC didnt have any teleports on it!

    Here is my TeleporterNPC...


    Code:
    function Npc_main_menu (Unit, event)
      Unit:GossipCreateMenu(3543, player, 0)
              Unit:GossipMenuAddItem(player, 2, "Teleports", 1, 0)
              Unit:GossipSendMenu(player)
    end
    
    function NPC_on_gossip_talk (Unit, event)
                    function NPC_main_menu (Unit, event)
    end
    
    function NPC_on_gossip_select(pUnit, event, player, id, intid, code)
      if(intid == 1) then
              pUnit:GossipCreateMenu(3543, player, 0)
    	   pUnit:GossipMenuAddItem(player, 2, "Alliance Cities", 5, 0)
    	   pUnit:GossipMenuAddItem(player, 2, "Horde Cities", 6, 0)
    	   pUnit:GossipMenuAddItem(player, 2, "Outland Locations", 7, 0)
    	   pUnit:GossipMenuAddItem(player, 2, "Player VS Player Zones", 8, 0)
               Unit:GossipSendMenu(player)
    end
    if(intid == 5) then
           pUnit:GossipCreateMenu(3543, player, 0)
               pUnit:GossipMenuAddItem(player, 4, "Stormwind City", 12, 0)
               pUnit:GossipMenuAddItem(player, 4, "Ironforge City", 13, 0)
               pUnit:GossipMenuAddItem(player, 4, "Darnassus", 14, 0)
               pUnit:GossipMenuAddItem(player, 4, "The Exodar", 15, 0)
               Unit:GossipSendMenu(player)
    end
    if(intid == 6) then
           pUnit:GossipCreateMenu(3543, player, 0)
               pUnit:GossipMenuAddItem(player, 4, "Orgrimmar", 16, 0)
               pUnit:GossipMenuAddItem(player, 4, "Undercity", 17, 0)
               pUnit:GossipMenuAddItem(player, 4, "Thunder Bluff", 18, 0)
               pUnit:GossipMenuAddItem(player, 4, "Silvermoon City", 19, 0)
               Unit:GossipSendMenu(player)
    end
    if(intid == 7) then
           pUnit:GossipCreateMenu(3543, player, 0)
               pUnit:GossipMenuAddItem(player, 4, "Hellfire Peninsula", 20, 0)
               pUnit:GossipMenuAddItem(player, 4, "Zangarmarsh", 21, 0)
               pUnit:GossipMenuAddItem(player, 4, "Nagrand", 22, 0)
               pUnit:GossipMenuAddItem(player, 4, "Terokkar Forest", 23, 0)
               pUnit:GossipMenuAddItem(player, 4, "Blade's Edge Mountains", 24, 0)
               pUnit:GossipMenuAddItem(player, 4, "Netherstorm", 25, 0)
               pUnit:GossipMenuAddItem(player, 4, "Shadowmoon Valley", 26, 0)
               Unit:GossipSendMenu(player)
    end
    if(intid == 8) then
           pUnit:GossipCreateMenu(3543, player, 0)
               pUnit:GossipMenuAddItem(player, 4, "Azshara Crater", 27, 0)
               pUnit:GossipMenuAddItem(player, 4, "Gurubashi Arena", 28, 0)
               pUnit:GossipMenuAddItem(player, 4, "Darkshore", 29, 0)
               pUnit:GossipMenuAddItem(player, 4, "Warsong Gulch", 30, 0)
               pUnit:GossipMenuAddItem(player, 4, "Arathi Basin", 31, 0)
               pUnit:GossipMenuAddItem(player, 4, "Arena", 32, 0)
               Unit:GossipSendMenu(player)
    end
    
    if(intid == 12) then
    player:Teleport(0, -8883.918945, 576.548340, 92.938957)
    end
    if(intid == 13) then
    player:Teleport(0, -4982.322754, -881.500549, 501.659668)
    end
    if(intid == 14) then
    player:Teleport(1, 9951.976563, 2280.426025, 1341.395020)
    end
    if(intid == 15) then
    player:Teleport(530, -3973.349854, -11882.410156, 0.620097)
    end
    
    if(intid == 16) then
    player:Teleport(1, 1503.979980, 04414.484375, 20.985382)
    end
    if(intid == 17) then
    player:Teleport(0, 1886.409912, 237.757629, 57.945694)
    end
    if(intid == 18) then
    player:Teleport(1, -1285.168823, 168.044693, 129.993958)
    end
    if(intid == 19) then
    player:Teleport(530, 9388.543945, -7278.262207, 14.240113)
    end
    
    if(intid == 20) then
    player:Teleport(530, -247.613129, 1022.351440, 54.326675)
    end
    if(intid == 21) then
    player:Teleport(530, 344.061981, 6832.742188, 48.054581)
    end
    if(intid == 22) then
    player:Teleport(530, -950.567810, 8289.909180, 20.559988)
    end
    if(intid == 23) then
    player:Teleport(530, -2012.084961, 4416.305664, 4.871132)
    end
    if(intid == 24) then
    player:Teleport(530, 1521.910034, 6807.100098, 117.710999)
    end
    if(intid == 25) then
    player:Teleport(530, 3389.094727, 4216.816406, 125.199997)
    end
    if(intid == 26) then
    player:Teleport(530, -3335.889893, 2131.929932, -1.984900)
    end
    
    if(intid == 27) then
    player:Teleport(37, 1051.168091, 293.195526, 339.560730)
    end
    if(intid == 28) then
    player:Teleport(0, -13275.827148, 273.500214, 42.979900)
    end
    if(intid == 29) then
    player:Teleport(1, 7367.605957, -1559.811279, 163.519073)
    end
    if(intid == 30) then
    player:Teleport(489, 1250.970215, 1554.557983, 309.649017)
    end
    if(intid == 31) then
    player:Teleport(529, 991.529846, 1008.540222, -42.603142)
    end
    if(intid == 32) then
    player:Teleport(559, 4011.070313, 2896.693115, 12.456406)
    end
    
    intid = 0
    end
    
    RegisterUnitGossipEvent(70010, 1, "NPC_on_gossip_talk")
    RegisterUnitGossipEvent(70010, 2, "NPC_on_gossip_select")
    end
    The NPC I am using has its flags set to 1 if that means anything.

    My arcemu-world.conf says


    <ScriptBackends LUA="1"
    AS="0">
    +Rep to someone who can help! (If I can, I don't know if I can yet, I am still a "Site Leecher")

    EDIT: It was Babbaa who helped me! (Response below )
    Last edited by _DEFiANT; 08-25-2008 at 05:06 PM.

    TeleporterNPC.lua not working!
  2. #2
    Babbaa's Avatar Member
    Reputation
    32
    Join Date
    Nov 2007
    Posts
    206
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured it out;

    Code:
     function Npc_main_menu (Unit, event)
      Unit:GossipCreateMenu(3543, player, 0)
              Unit:GossipMenuAddItem(player, 2, "Teleports", 1, 0)
    Unit:GossipMenuAddItem(player, 2, "---------", 2, 0)
    Unit:GossipMenuAddItem(player, 2, "---------", 3, 0)
              Unit:GossipSendMenu(player)
    Add the two red line, Because from my Experience, you can't just have one Menu, you need atleast two to make it pop up.
    (pst, I'm the one who helped you with it)
    ~~ Babbaa

  3. #3
    _DEFiANT's Avatar Member
    Reputation
    44
    Join Date
    Aug 2008
    Posts
    240
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Babbaa View Post
    I figured it out;

    Code:
     function Npc_main_menu (Unit, event)
      Unit:GossipCreateMenu(3543, player, 0)
              Unit:GossipMenuAddItem(player, 2, "Teleports", 1, 0)
    Unit:GossipMenuAddItem(player, 2, "---------", 2, 0)
    Unit:GossipMenuAddItem(player, 2, "---------", 3, 0)
              Unit:GossipSendMenu(player)
    Add the two red line, Because from my Experience, you can't just have one Menu, you need atleast two to make it pop up.
    (pst, I'm the one who helped you with it)
    ~~ Babbaa
    I wish that would of worked

    But alas.. it didn't...

    He still just says "Hey there, Warlockian. How can I help you?"

  4. #4
    Shao111's Avatar Active Member
    Reputation
    33
    Join Date
    Jul 2007
    Posts
    281
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Warlockian View Post
    I wish that would of worked

    But alas.. it didn't...

    He still just says "Hey there, Warlockian. How can I help you?"
    May have something to do with the npcs flags, I think he needs to be flagged for gossip, not sure on that though.


  5. #5
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Gossip is 2... Try flaggin the character type 2 and see what happens.

  6. #6
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Npc_main_menu (Unit, event)
      Unit:GossipCreateMenu(3543, player, 0)
              Unit:GossipMenuAddItem(player, 2, "Teleports", 1, 0)
              Unit:GossipSendMenu(player)
    Try changing that in red to 3544.


  7. #7
    _DEFiANT's Avatar Member
    Reputation
    44
    Join Date
    Aug 2008
    Posts
    240
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Performer View Post
    Code:
    function Npc_main_menu (Unit, event)
      Unit:GossipCreateMenu(3543, player, 0)
              Unit:GossipMenuAddItem(player, 2, "Teleports", 1, 0)
              Unit:GossipSendMenu(player)
    Try changing that in red to 3544.

    Tried setting his flags to 2 and changing it to 3544. I couldn't even talk to him now. I changed his flags back to 1 but he still said "Hey there, Warlockian. How can I help you?"


  8. #8
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Flags are ment to be 1 not 2.

    Check in your console for errors.

    EntryID Correct?

    Code:
    function Npc_main_menu (Unit, event)
      pUnit:GossipCreateMenu(3543, player, 0)
              pUnit:GossipMenuAddItem(player, 2, "Teleports", 1, 0)
              pUnit:GossipSendMenu(player)
    end


    Make sure you use pUnit ALL over the script if you use it. Same with unit.

    Change any other "Unit" to "pUnit"
    Last edited by Performer; 08-25-2008 at 09:15 PM.


  9. #9
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah sorry i apologize Quest giver is 2.. Guide is 1... My bad,

  10. #10
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And doesnt any commands that have an IF have to have Two ends?

  11. #11
    _DEFiANT's Avatar Member
    Reputation
    44
    Join Date
    Aug 2008
    Posts
    240
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Performer View Post
    Flags are ment to be 1 not 2.

    Check in your console for errors.

    EntryID Correct?

    Code:
    function Npc_main_menu (Unit, event)
      pUnit:GossipCreateMenu(3543, player, 0)
              pUnit:GossipMenuAddItem(player, 2, "Teleports", 1, 0)
              pUnit:GossipSendMenu(player)
    end


    Make sure you use pUnit ALL over the script if you use it. Same with unit.

    Change any other "Unit" to "pUnit"
    Well, I went through the script and changed all Units to pUnits. Still didn't work. This is giving me a major headache

  12. #12
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try adding Double Ends whereever theres an if

  13. #13
    _DEFiANT's Avatar Member
    Reputation
    44
    Join Date
    Aug 2008
    Posts
    240
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kreegoth View Post
    Try adding Double Ends whereever theres an if
    Babbaa came online and started helping me. Found out that my current repack (Scyther's Repack) was outdated. So now I have decided to compile my own server.

    +Rep to people who helped


Similar Threads

  1. [ArcEmu] LUA not working.. Any ideas?
    By tiesmik in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 02-21-2011, 11:22 AM
  2. brand new lua(not working in game need help)
    By Flake0207 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 06-24-2009, 04:03 PM
  3. LUA Not Working?
    By Protyke in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 04-26-2009, 03:18 AM
  4. LUA Not Working.
    By pplzperson in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 08-13-2008, 08:12 AM
  5. [Help] Lua not working
    By Lich King in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 03-15-2008, 04:41 PM
All times are GMT -5. The time now is 03:44 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search