LUA Help menu

User Tag List

Thread: LUA Help

Results 1 to 7 of 7
  1. #1
    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)

    LUA Help

    I need help with a script I've been working on.

    Code:
    if player:GetRace() == 1 or player:GetRace() == 3 or player:GetRace() == 4 or player:GetRace() == 7 then
    function warp_on_gossip_talk(unit, event, player)
    	unit:CreatGossipMenuForPlayer(3543, player)
    	unit:MenuAddItem(player, 0, "Azshara Crater", 7, 0)
    	unit:MenuAddItem(player, 0, "Azeroth Instances", 2, 0)
    	unit:MenuAddItem(player, 0, "Outland Instances", 3, 0)
    	unit:MenuAddItem(player, 0, "Remove Rez Sickness", 5, 0)
    	unit:MenuSendToPlayer(player)
    end
    
    else
    
    function warp_on_gossip_talk(unit, event, player)
    	unit:CreatGossipMenuForPlayer(3543, player)
    	unit:MenuAddItem(player, 0, "Azshara Crater", 1, 0)
    	unit:MenuAddItem(player, 0, "Azeroth Instances", 2, 0)
    	unit:MenuAddItem(player, 0, "Outland Instances", 3, 0)
    	unit:MenuAddItem(player, 0, "Remove Rez Sickness", 5, 0)
    	unit:MenuSendToPlayer(player)
    end
    This isn't exactly working right. I just get the normal "What can I do for you" message from my NPC. Anyone know what I can do to fix this?

    LUA Help
  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)
    You havn't registered it and it's not going to teleport the player... I advise you go have a look at some other teleport npc layouts like:
    http://www.mmowned.com/forums/emulat...-friendly.html

  3. #3
    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)
    Sorry. I only posted this part because its the part that isn't working. I've tested it without the GetRace() and it works. I just need it so that the horde can't get to alliance cities and vice versa.

  4. #4
    Aznex's Avatar Contributor
    Reputation
    128
    Join Date
    Feb 2008
    Posts
    770
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    :GetFaction() -- returns the faction number. ?

  5. #5
    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)
    Code:
    if player:GetFaction() == 1 then
    function warp_on_gossip_talk(unit, event, player)
    	unit:CreatGossipMenuForPlayer(3543, player)
    	unit:MenuAddItem(player, 0, "Azshara Crater", 7, 0)
    	unit:MenuAddItem(player, 0, "Azeroth Instances", 2, 0)
    	unit:MenuAddItem(player, 0, "Outland Instances", 3, 0)
    	unit:MenuAddItem(player, 0, "Remove Rez Sickness", 5, 0)
    	unit:MenuSendToPlayer(player)
    end
    
    else
    
    function warp_on_gossip_talk(unit, event, player)
    	unit:CreatGossipMenuForPlayer(3543, player)
    	unit:MenuAddItem(player, 0, "Azshara Crater", 1, 0)
    	unit:MenuAddItem(player, 0, "Azeroth Instances", 2, 0)
    	unit:MenuAddItem(player, 0, "Outland Instances", 3, 0)
    	unit:MenuAddItem(player, 0, "Remove Rez Sickness", 5, 0)
    	unit:MenuSendToPlayer(player)
    end
    That should do it?

  6. #6
    Aznex's Avatar Contributor
    Reputation
    128
    Join Date
    Feb 2008
    Posts
    770
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
     
    function warp_on_gossip_talk(unit, event, player)
            if player:GetFaction() == 1 then
    	pUnit:CreatGossipMenuForPlayer(3543, player)
    	pUnit:MenuAddItem(player, 0, "Azshara Crater", 7, 0)
    	pUnit:MenuAddItem(player, 0, "Azeroth Instances", 2, 0)
    	pUnit:MenuAddItem(player, 0, "Outland Instances", 3, 0)
    	pUnit:MenuAddItem(player, 0, "Remove Rez Sickness", 5, 0)
    	pUnit:MenuSendToPlayer(player)
    end
    
    else
            pUnit:CreatGossipMenuForPlayer(3543, player)
    	pUnit:MenuAddItem(player, 0, "Azshara Crater", 1, 0)
    	pUnit:MenuAddItem(player, 0, "Azeroth Instances", 2, 0)
    	pUnit:MenuAddItem(player, 0, "Outland Instances", 3, 0)
    	pUnit:MenuAddItem(player, 0, "Remove Rez Sickness", 5, 0)
    	pUnit:MenuSendToPlayer(player)
    end
    end
    I think( did it out of the back of my head)
    Last edited by Aznex; 10-04-2008 at 12:38 PM.

  7. #7
    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)
    Thank you so much +Rep Huge help. Would give more if I could

Similar Threads

  1. [Help] Need LUA help? Post here!
    By EcHoEs in forum World of Warcraft Emulator Servers
    Replies: 20
    Last Post: 10-03-2010, 01:18 PM
  2. [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
  3. LUA help
    By stoneharry in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 02-25-2008, 03:27 PM
  4. Lua help
    By reconz in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-18-2008, 07:03 PM
  5. Lua help
    By Tom_2001 in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 02-04-2008, 12:17 PM
All times are GMT -5. The time now is 09:13 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