lua script help menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    igud2's Avatar Member
    Reputation
    10
    Join Date
    Nov 2007
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    lua script help

    lua script help

    im working on a lua profession npc


    Code:
    function On_Gossip (pUnit, event, player)
    punit:GossipCreateMenu(50, player, 0)
    punit:GossipMenuAddItem(7, "welcome to the professions npc, click on each to learn that profession.", 5);
    punit:GossipMenuAddItem(8, "enchanting", 96);
    punit:GossipMenuAddItem(8, "tailoring", 95);
    punit:GossipMenuAddItem(8, "engineering", 94);
    punit:GossipMenuAddItem(8, "jewelcrafting", 93);
    punit:GossipMenuAddItem(8, "alchemy", 92);
    punit:GossipMenuAddItem(8, "black smith", 91);
    punit:GossipMenuAddItem(8, "herbalism", 90);
    punit:GossipMenuAddItem(8, "leather working", 89);
    punit:GossipMenuAddItem(8, "mining", 88);
    punit:GossipMenuAddItem(8, "skinning", 87);
    punit:GossipMenuAddItem(8, "cooking", 86);
    punit:GossipMenuAddItem(8, "first aid", 85);
    punit:GossipMenuAddItem(8, "fishing", 84);
    punit:GossipMenuAddItem(5, "set my profession skills to 450", 50);
    punit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus (pUnit, event, player, id, intid, code)
    
    if (intid == 96) then
    player:Learnspell(28030)
    punit:GossipComplete(player)
    punit:SendChatMessage("enchanting learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 95) then
    player:Learnspell(3912)
    punit:GossipComplete(player)
    punit:SendChatMessage("tailoring learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 94) then
    player:Learnspell(30351)
    punit:GossipComplete(player)
    punit:SendChatMessage("Engineering learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    if (intid == 93) then
    player:Learnspell(28901)
    punit:GossipComplete(player)
    punit:SendChatMessage("Jewelcrafting learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    end
    
    if (intid == 92) then
    player:Learnspell(28597)
    punit:GossipComplete(player)
    punit:SendChatMessage("Alchemy learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 91) then
    player:Learnspell(29845)
    punit:GossipComplete(player)
    punit:SendChatMessage("Blacksmithing learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 90) then
    player:Learnspell(28696)
    punit:GossipComplete(player)
    punit:SendChatMessage("Herbalism learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 89) then
    player:Learnspell(32550)
    punit:GossipComplete(player)
    punit:SendChatMessage("Leatherworking learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 88) then
    player:Learnspell(29355)
    punit:GossipComplete()
    punit:SendChatMessage("Mining learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 87) then
    player:Learnspell(32679)
    punit:GossipComplete(player)
    punit:SendChatMessage("Skinning learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    if (intid == 86) then
    player:Learnspell(33360)
    punit:GossipComplete(player)
    punit:SendChatMessage("Cooking learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 85) then
    player:Learnspell(33894)
    punit:GossipComplete(player)
    punit:SendChatMessage("First Aid learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 84) then
    player:Learnspell(33098)
    punit:GossipComplete(player)
    punit:SendChatMessage("Fishing learned")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    
    if (intid == 50) then
    player:AdvanceSkill(333, 450);
    player:AdvanceSkill(197, 450);
    player:AdvanceSkill(202, 450);
    player:AdvanceSkill(755, 450);
    player:AdvanceSkill(171, 450);
    player:AdvanceSkill(164, 450);
    player:AdvanceSkill(182, 450);
    player:AdvanceSkill(165, 450);
    player:AdvanceSkill(186, 450);
    player:AdvanceSkill(393, 450);
    player:AdvanceSkill(185, 450);
    player:AdvanceSkill(129, 450);
    player:AdvanceSkill(356, 450);
    punit:GossipComplete(player)
    punit:SendChatMessage("All Skills At Max")
    punit:GossipMenuAddItem(0, "[Back]", 5, 0)
    punit:GossipSendMenu(player)
    end
    end
    
    RegisterUnitGossipEvent(110101, 1, "On_Gossip")
    RegisterUnitGossipEvent(110101, 2, "Gossip_Submenus")
    and this is what i get a nil value some help would be appreciated


    lua script help
  2. #2
    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)
    I'm not sure, but try changing all the 'punit' to 'pUnit' instead. Tell me if it works.

  3. #3
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, Lua is case-sensitive. 'punit' does not work. Change it to 'pUnit' for it to function correctly.

    Also, what exactly is your error? (image broken?)

    Claiver

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 07:06 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