LUA Help Request menu

User Tag List

Results 1 to 3 of 3
  1. #1
    erebos's Avatar Active Member
    Reputation
    27
    Join Date
    Aug 2007
    Posts
    114
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Help Request

    Well this is my first attempt making a lua teleporter, but i get this problem.

    Heres the code:

    Code:
    function blackout_menu(pUnit, player)
       pUnit:GossipCreateMenu(3544, player, 0)
       pUnit:GossipMenuAddItem(5, "Hordes", 16, 0)
       pUnit:GossipMenuAddItem(5, "Alliance", 15, 0)
       pUnit:GossipMenuAddItem(6, "Black0uT Starting Stuff", 136, 0)
       pUnit:GossipMenuAddItem(8, "Buff Spells", 900, 0)
       pUnit:GossipSendMenu(player)
       end
    
    function blackout_gossip_speak(pUnit, event, player)
    blackout_menu(pUnit, player)
    end
    
    function blackout_gossip_select(pUnit, event, player, id, intid, code, pMisc)
    if(intid == 100) then
    pUnit:GossipCreateMenu(3544, player, 0)
       pUnit:GossipCreateMenu(3544, player, 0)
       pUnit:GossipMenuAddItem(5, "Hordes", 16, 0)
       pUnit:GossipMenuAddItem(5, "Alliance", 15, 0)
       pUnit:GossipMenuAddItem(6, "Black0uT Starting Gear", 136, 0)
       pUnit:GossipMenuAddItem(8, "Buff Spells", 900, 0)
       pUnit:GossipSendMenu(player)
       end
     
    if(intid == 16) then
    pUnit:GossipCreateMenu(3543, player, 0) 
    pUnit:GossipMenuAddItem(1, "Orgrimmar", 38, 0)
    pUnit:GossipMenuAddItem(1, "Undercity", 39, 0)
    pUnit:GossipMenuAddItem(1, "Thunder Bluff", 40, 0)
    pUnit:GossipMenuAddItem(1, "Silvermoon City", 41, 0)
    pUnit:GossipMenuAddItem(2, "Back", 100, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if(intid == 15) then
    pUnit:GossipCreateMenu(3543, player, 0) 
    pUnit:GossipMenuAddItem(1, "Stormwind", 34, 0)
    pUnit:GossipMenuAddItem(1, "Ironforge", 35, 0)
    pUnit:GossipMenuAddItem(1, "Darnassus", 36, 0)
    pUnit:GossipMenuAddItem(1, "The Exodar", 37, 0)
    pUnit:GossipMenuAddItem(2, "Back", 100, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if(intid == 136) then 
    pUnit:GossipCreateMenu(3543, player, 0)
    pUnit:GossipMenuAddItem(6, "Black0ut Starter Gear", 10, 0)
    pUnit:GossipMenuAddItem(6, "Black0ut Ressurection", 13, 0) 
    pUnit:GossipMenuAddItem(6, "Black0ut Elixirs", 258, 0)
    pUnit:GossipMenuAddItem(6, "Black0ut Scrolls", 259, 0)
    pUnit:GossipMenuAddItem(5, "Go Back", 100, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if(intid == 10) then
     player:AddItem(41125,2)
     player:AddItem(41126,2)
     player:AddItem(41123,1)
     player:AddItem(41124,1)
     pUnit:GossipComplete(player)
     end
    
    if(intid == 13) then 
     player:LearnSpell(21169)
     player:AddItem(17030,100)
     pUnit:GossipComplete(player)
     end
    
    if(intid == 258) then
     player:AddItem(32948,5)
     player:AddItem(32947,5)
     player:AddItem(22833,5)
     player:AddItem(22827,5)
     player:AddItem(22835,5)
     player:AddItem(22824,5)
     player:AddItem(32063,5)
     player:AddItem(32067,5)
     player:AddItem(32068,5)
     player:AddItem(32062,5)
     pUnit:GossipComplete(player)
     end
    
    if(intid == 259) then
     player:AddItem(32947,10)
     player:AddItem(32948,10)
     player:AddItem(31677,10)
     player:AddItem(31676,10)
     player:AddItem(22849,10)
     player:AddItem(22836,10)
     pUnit:GossipComplete(player)
     end
    
    if(intid == 900) then 
     player:LearnSpell(33081)
     player:LearnSpell(33082)
     player:LearnSpell(33077)
     player:LearnSpell(33079)
     player:LearnSpell(33080)
     player:LearnSpell(33078)
     pUnit:GossipComplete(player)
     end
    
    RegisterUnitGossipEvent(8, 1, "blackout_gossip_speak") 
    RegisterUnitGossipEvent(8, 2, "blackout_gossip_select")
    if you check this part

    Code:
    function blackout_gossip_speak(pUnit, event, player)
    blackout_menu(pUnit, player)
    end
    I dont really now but i think theres the problem because if i close that with "end" the lua loads and i get the menu but if i click nothing happens.

    On the other hand if i dont put "end" there it gives me an error and doesnt loads.

    Could anyone take a look at it and see what the problem is.

    LUA Help Request
  2. #2
    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:
    local npcid = 200005
    
    function blackout_OnGossipTalk(pUnit,event, player, pMisc)
    	pUnit:GossipCreateMenu(3544, player, 0)
    	pUnit:GossipMenuAddItem(5, "Hordes", 16, 0)
    	pUnit:GossipMenuAddItem(5, "Alliance", 15, 0)
    	pUnit:GossipMenuAddItem(6, "Black0uT Starting Stuff", 136, 0)
    	pUnit:GossipMenuAddItem(8, "Buff Spells", 900, 0)
    	pUnit:GossipSendMenu(player)
    end
    
    function blackout_OnGossip_Select(pUnit, event, player, id, intid, code, pMisc)
    if(intid == 16) then
    	pUnit:GossipCreateMenu(3543, player, 0) 
    	pUnit:GossipMenuAddItem(1, "Orgrimmar", 38, 0)
    	pUnit:GossipMenuAddItem(1, "Undercity", 39, 0)
    	pUnit:GossipMenuAddItem(1, "Thunder Bluff", 40, 0)
    	pUnit:GossipMenuAddItem(1, "Silvermoon City", 41, 0)
    	pUnit:GossipMenuAddItem(2, "Back", 100, 0)
    	pUnit:GossipSendMenu(player)
    end
    if(intid == 15) then
    	pUnit:GossipCreateMenu(3543, player, 0) 
    	pUnit:GossipMenuAddItem(1, "Stormwind", 34, 0)
    	pUnit:GossipMenuAddItem(1, "Ironforge", 35, 0)
    	pUnit:GossipMenuAddItem(1, "Darnassus", 36, 0)
    	pUnit:GossipMenuAddItem(1, "The Exodar", 37, 0)
    	pUnit:GossipMenuAddItem(2, "Back", 100, 0)
    	pUnit:GossipSendMenu(player)
    end
    if(intid == 136) then 
    	pUnit:GossipCreateMenu(3543, player, 0)
    	pUnit:GossipMenuAddItem(6, "Black0ut Starter Gear", 10, 0)
    	pUnit:GossipMenuAddItem(6, "Black0ut Ressurection", 13, 0) 
    	pUnit:GossipMenuAddItem(6, "Black0ut Elixirs", 258, 0)
    	pUnit:GossipMenuAddItem(6, "Black0ut Scrolls", 259, 0)
    	pUnit:GossipMenuAddItem(5, "Go Back", 100, 0)
    	pUnit:GossipSendMenu(player)
    end
    if(intid == 10) then
    	player:AddItem(41125,2)
    	player:AddItem(41126,2)
    	player:AddItem(41123,1)
    	player:AddItem(41124,1)
    	pUnit:GossipComplete(player)
    end
    if(intid == 13) then 
    	player:LearnSpell(21169)
    	player:AddItem(17030,100)
    	pUnit:GossipComplete(player)
    end
    if(intid == 258) then
    	player:AddItem(32948,5)
    	player:AddItem(32947,5)
    	player:AddItem(22833,5)
    	player:AddItem(22827,5)
    	player:AddItem(22835,5)
    	player:AddItem(22824,5)
    	player:AddItem(32063,5)
    	player:AddItem(32067,5)
    	player:AddItem(32068,5)
    	player:AddItem(32062,5)
    	pUnit:GossipComplete(player)
    end
    if(intid == 259) then
    	player:AddItem(32947,10)
    	player:AddItem(32948,10)
    	player:AddItem(31677,10)
    	player:AddItem(31676,10)
    	player:AddItem(22849,10)
    	player:AddItem(22836,10)
    	pUnit:GossipComplete(player)
    end
    if(intid == 900) then 
    	player:LearnSpell(33081)
    	player:LearnSpell(33082)
    	player:LearnSpell(33077)
    	player:LearnSpell(33079)
    	player:LearnSpell(33080)
    	player:LearnSpell(33078)
    	pUnit:GossipComplete(player)
    end
    end
    
    RegisterUnitGossipEvent(200005,1,"blackout_OnGossipTalk") 
    RegisterUnitGossipEvent(200005,2,"blackout_OnGossip_Select")
    That should do it it uses an NPC with id 200005 in your database; if u want to change switch stuff in red with the ID your npc uses.
    Code:
     local npcid = 200005
    Code:
     RegisterUnitGossipEvent(200005,1,"blackout_OnGossipTalk") 
    RegisterUnitGossipEvent(200005,2,"blackout_OnGossip_Select")

  3. #3
    erebos's Avatar Active Member
    Reputation
    27
    Join Date
    Aug 2007
    Posts
    114
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aznez thank you so much, it work perfectly. +Rep

    Btw since im getting started in this lua stuff do you have a msn or something to give me a hand if i mess up again.

    Edit: Sorry i have given all my rep today....

Similar Threads

  1. Lua BossFight Help Request
    By hellmix in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 10-30-2009, 07:59 PM
  2. [Request] A small lua help.
    By Ellenor in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 08-30-2008, 01:33 AM
  3. [HELP/Request] LUA Script
    By Babbaa in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 07-29-2008, 07:34 AM
  4. Getting A Friend Connected (Help Request)
    By Magnusvermis in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 12-07-2007, 11:57 PM
  5. Help Request
    By sirios in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 10-14-2007, 12:47 PM
All times are GMT -5. The time now is 06:52 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