Need some help with Lua menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    Kiev's Avatar Contributor
    Reputation
    288
    Join Date
    Nov 2007
    Posts
    1,819
    Thanks G/R
    0/4
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need some help with Lua

    Hello, i am trying to script a Mob, but for some reason it wont work, can you help me?

    What it says is Line 28 Unexpected Symbol near &, any help?

    Code:
    local npcid = 49996
    local pclass = player:GetPlayerClass()
    function NPC_main_menu(pUnit, player)
       pUnit:GossipCreateMenu(3543, player, 0)
       pUnit:GossipMenuAddItem(0, "Welcome to Power WoW's Custom Trainer", 1, 0)
       pUnit:GossipMenuAddItem(0, "I am here to train you ur missing spells.", 2, 0)
       pUnit:GossipMenuAddItem(3, "Hunter.", 3, 0)
       pUnit:GossipMenuAddItem(3, "Warlock", 4, 0)   
       pUnit:GossipSendMenu(player)
    end
    function NPC_on_gossip_talk(pUnit, event, player)
       NPC_main_menu(pUnit, player)
    end
    function NPC_on_gossip_select(pUnit, event, player, id, intid, code, pMisc)
    if(intid == 3) then
    if ( class[pclass] == 3 ) then
     pUnit:GossipCreateMenu(3543, player, 0)
     pUnit:GossipMenuAddItem(4, "Hello, this is the Hunter Training Area, Please click one of the following spells to learn them.", 100, 0)
     pUnit:GossipMenuAddItem(3, "Pet Skills", 10, 0)
     pUnit:GossipMenuAddItem(3, "Arcane Shot", 11, 0)
     pUnit:GossipMenuAddItem(0, "Back", 100, 0)
     pUnit:GossipSendMenu(player)
    end
    if(intid == 4) then && if ( class[pclass] == 9) then
     pUnit:GossipCreateMenu(3543, player, 0)
     pUnit:GossipMenuAddItem(4, "Hello, this is the Warlock Training Area, Please click one of the following spells to learn them.", 100, 0)
     pUnit:GossipMenuAddItem(4, "Give me my Pets Please", 12, 0)
     pUnit:GossipSendMenu(player)
    end
    if ( class[pclass] == 3 ) then
    if(intid == 10) then
       pUnit:GossipMenuAddItem(0, "Welcome to Power WoW's Custom Trainer", 1, 0)
       pUnit:GossipMenuAddItem(0, "I am here to train you ur missing spells.", 2, 0)
       pUnit:GossipMenuAddItem(3, "Hunter.", 3, 0)
       pUnit:GossipMenuAddItem(3, "Warlock", 4, 0) 
     player:AddSpell(883)     
     player:AddSpell(2641)
     player:AddSpell(6991)
     player:AddSpell(982)
     player:AddSpell(1515)
     player:AddSpell(5149)
    end
    if(intid == 100) then
        pUnit:GossipCreateMenu(3543, player, 0)
       pUnit:GossipMenuAddItem(0, "Welcome to Power WoW's Custom Trainer", 1, 0)
       pUnit:GossipMenuAddItem(0, "I am here to train you ur missing spells.", 2, 0)
       pUnit:GossipMenuAddItem(3, "Hunter.", 3, 0)
       pUnit:GossipMenuAddItem(3, "Warlock", 4, 0)     
       pUnit:GossipSendMenu(player)
    end
    end
    RegisterUnitGossipEvent(49996, 1, "NPC_on_gossip_talk") 
    RegisterUnitGossipEvent(49996, 2, "NPC_on_gossip_select")

    Need some help with Lua
  2. #2
    Confucius's Avatar Super Moderator The Idiot

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1401
    Join Date
    Oct 2007
    Posts
    2,668
    Thanks G/R
    290/295
    Trade Feedback
    7 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Search the forums there are many guides on this.

  3. #3
    Kiev's Avatar Contributor
    Reputation
    288
    Join Date
    Nov 2007
    Posts
    1,819
    Thanks G/R
    0/4
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cant find no help, can anyone else help me please?

  4. #4
    VictoRo's Avatar Contributor
    Reputation
    81
    Join Date
    Feb 2008
    Posts
    219
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if(intid == 4) then && if ( class[pclass] == 9) then
    Try removing one of the & or them both.

  5. #5
    Kiev's Avatar Contributor
    Reputation
    288
    Join Date
    Nov 2007
    Posts
    1,819
    Thanks G/R
    0/4
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dont worry, i fixed it now, could someone delete it please? And +Rep to Victor for trying to help me

Similar Threads

  1. Need some help with unlocked LUA scripting (UnitBuff)
    By ownedpandas in forum WoW UI, Macros and Talent Specs
    Replies: 0
    Last Post: 10-13-2016, 10:55 AM
  2. [Lua Script] Need some help with my lua script
    By riizu in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 07-13-2010, 01:40 AM
  3. Need some help with LUA script
    By SupernovaHH in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-22-2009, 07:25 AM
  4. [Request] I need some help with lua script (boss on death)
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 03-03-2008, 03:47 PM
  5. NEED SOME HELP with Model Editing
    By Dwarf in forum World of Warcraft Model Editing
    Replies: 4
    Last Post: 09-12-2006, 08:12 PM
All times are GMT -5. The time now is 11:47 AM. 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