LUA Script Help. menu

User Tag List

Results 1 to 2 of 2
  1. #1
    EmuX's Avatar Active Member
    Reputation
    29
    Join Date
    Feb 2008
    Posts
    172
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Script Help.

    I am having a problem with an LUA script, it's kinda weird cause 1 of them work and the other doesn't and there the same script.

    So the way it works is Nefarian drops his head and it starts a quest, you hand this quest in to an NPC and it allows you to teleport to an instance after.

    There is an alliance version of the quest and a horde version, currently only the alliance version works.

    Here is the horde script (Not working):

    Code:
    function On_Gossip(pUnit, event, player)
     if (player:HasFinishedQuest(8) == true) then
     pUnit:GossipCreateMenu(14772, player, 0)
     pUnit:GossipMenuAddItem(0, "Teleport me!", 1, 0)
     pUnit:GossipSendMenu(player)
     else
     pUnit:SendBroadcastMessage("You need to do the quest first!")
    end
    end
    
    function Gossip_Submenus(pUnit, event, player, id, intid, code)
     if(intid == 1) then
     player:Teleport(34, 49.821201, 0.870144, -16.713614)
    end
    end
    
    RegisterUnitGossipEvent(14772, 1, "On_Gossip")
    RegisterUnitGossipEvent(14772, 2, "Gossip_Submenus")
    And the alliance version witch is working:

    Code:
    function On_Gossip(pUnit, event, player)
     if (player:HasFinishedQuest(9) == true) then
     pUnit:GossipCreateMenu(14762, player, 0)
     pUnit:GossipMenuAddItem(0, "Teleport me!", 1, 0)
     pUnit:GossipSendMenu(player)
     else
     pUnit:SendBroadcastMessage("You need to do the quest first!")
    end
    end
    
    function Gossip_Submenus(pUnit, event, player, id, intid, code)
     if(intid == 1) then
     player:Teleport(34, 49.821201, 0.870144, -16.713614)
    end
    end
    
    RegisterUnitGossipEvent(14762, 1, "On_Gossip")
    RegisterUnitGossipEvent(14762, 2, "Gossip_Submenus")
    If you have any idea what I have done wrong please add me on MSN [email protected] or post below.

    Thanks!
    Last edited by EmuX; 10-27-2009 at 09:10 PM.

    LUA Script Help.
  2. #2
    shadowslayer133's Avatar Active Member
    Reputation
    61
    Join Date
    May 2008
    Posts
    313
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    They both had registered the same events which were, Gossip_Submenus and On_Gossip, you need to vary them or else it will only register on and it will work on all creatures who register it, so the alliance script will work with the horde and alliance npc if you don't register it correctly.


    Code:
    function Tele_On_Gossip(pUnit, event, player)
     if (player:HasFinishedQuest(8) == true) then
     pUnit:GossipCreateMenu(14772, player, 0)
     pUnit:GossipMenuAddItem(0, "Teleport me!", 1, 0)
     pUnit:GossipSendMenu(player)
     else
     pUnit:SendBroadcastMessage("You need to do the quest first!")
    end
    end
    
    function Tele_Gossip_Submenus(pUnit, event, player, id, intid, code)
     if(intid == 1) then
     player:Teleport(34, 49.821201, 0.870144, -16.713614)
    end
    end
    
    RegisterUnitGossipEvent(14772, 1, "Tele_On_Gossip")
    RegisterUnitGossipEvent(14772, 2, "Tele_Gossip_Submenus")
    Code:
    Code:
    function Teleporter_On_Gossip(pUnit, event, player)
     if (player:HasFinishedQuest(9) == true) then
     pUnit:GossipCreateMenu(14762, player, 0)
     pUnit:GossipMenuAddItem(0, "Teleport me!", 1, 0)
     pUnit:GossipSendMenu(player)
     else
     pUnit:SendBroadcastMessage("You need to do the quest first!")
    end
    end
    
    function Teleporter_Gossip_Submenus(pUnit, event, player, id, intid, code)
     if(intid == 1) then
     player:Teleport(34, 49.821201, 0.870144, -16.713614)
    end
    end
    
    RegisterUnitGossipEvent(14762, 1, "Teleporter_On_Gossip")
    RegisterUnitGossipEvent(14762, 2, "Teleporter_Gossip_Submenus")

    Done by piersd
    Gamer tag - Midnight133

Similar Threads

  1. Simple LUA Script Help
    By Wolfly in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 09-02-2008, 04:22 PM
  2. LUA Script Help Thread
    By mager1794 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 07-04-2008, 12:46 AM
  3. LuA Scripting Help
    By Jlp in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 06-27-2008, 03:33 AM
  4. Lua script help and general questions from beginner
    By WinKIller0 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 02-23-2008, 04:38 AM
  5. Need LUA Scripting Help ?
    By Snailz in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 02-04-2008, 12:36 PM
All times are GMT -5. The time now is 08:51 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