Halp please lua script not working menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    thebigman's Avatar Contributor Reliable Trader
    CoreCoins Purchaser
    Reputation
    89
    Join Date
    Dec 2008
    Posts
    605
    Thanks G/R
    2/0
    Trade Feedback
    26 (96%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Halp please lua script not working

    I made this script and its supposed to go to a submenu, then click an item to exchange for one of my tokens or rewards. What it does instead is nothing unless i click the first choice on the initial menu, then it gives me all of the rewards without even checking for the token, (I put token/nil checks in there to MAKE SURE you have a token to do so.) so I have no idea how to fix it, perhaps you guys can help me.


    Code:
    local npcid = 5009010
    
    function On_Gossip_Menu(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(9, "Bijou's into Ethereal Credits!", 1, 0)
    unit:GossipMenuAddItem(9, "Ethereal credit exchange store.", 2, 0)
    unit:GossipMenuAddItem(9, "Sell your items for Ethereal Credit!", 3, 0)
    unit:GossipSendMenu(player)
    end
    
    function On_Gossip_Menu_select(Unit, event, player, id, intid, code)
    if (intid == 1) then
    Unit:GossipCreateMenu(99, player, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X1", 13371, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X3", 13372, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X5", 13373, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X10", 13374, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X20", 13375, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X50", 13376, 0)
    Unit:GossipSendMenu(player)
    end
    
    if (intid == 2) then
    Unit:GossipCreateMenu(98, player, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Warsong gulch marks X1 for 10 Credits", 13377, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Warsong gulch marks X3 for 30 Credits", 13378, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Warsong gulch marks X5 for 50 Credits", 13379, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Swift Spectral Tiger for 500 Credits", 133710, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Murloc Suit for 250 Credits", 133711, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Picnic Basket for 100 Credits", 133712, 0)
    Unit:GossipSendMenu(player)
    end
    
    
    if (intid == 3) then
    Unit:GossipCreateMenu(97, player, 0)
    unit:GossipMenuAddItem(0, "|cFFFFD700!Coming Soon!", 21, 0)
    Unit:GossipSendMenu(player)
    end
    
    if (intid == 13371) and (player:GetItemCount(19712) < 1) then
    			player:SendAreaTriggerMessage("You need 1 Purple Bijou for this item!!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 1)
    			player:AddItem( 38186, 1)
    			player:GossipComplete()
    end
    
    if (intid == 13372) and (player:GetItemCount(19712) < 3) then
    			player:SendAreaTriggerMessage("You need 3 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 3)
    			player:AddItem( 38186, 3)
    			player:GossipComplete()
    end
    
    if (intid == 13373) and (player:GetItemCount(19712) < 5) then
    			player:SendAreaTriggerMessage("You need 5 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 5)
    			player:AddItem( 38186, 5)
    			player:GossipComplete()
    end
    
    if (intid == 13374) and (player:GetItemCount(19712) < 10) then
    			player:SendAreaTriggerMessage("You need 10 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 10)
    			player:AddItem( 38186, 10)
    			player:GossipComplete()
    end
    
    if (intid == 13375) and (player:GetItemCount(19712) < 20) then
    			player:SendAreaTriggerMessage("You need 20 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 20)
    			player:AddItem( 38186, 20)
    			player:GossipComplete()
    end
    
    if (intid == 13376) and (player:GetItemCount(19712) < 50) then
    			player:SendAreaTriggerMessage("You need 50 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 50)
    			player:AddItem( 38186, 1)
    			player:GossipComplete()
    end
    
    if (intid == 13377) and (player:GetItemCount(38186) < 10) then
    			player:SendAreaTriggerMessage("You need 10 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 10)
    			player:AddItem( 20558, 1)
    			player:GossipComplete()
    end
    
    if (intid == 13378) and (player:GetItemCount(38186) < 30) then
    			player:SendAreaTriggerMessage("You need 30 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 30)
    			player:AddItem( 20558, 3)
    			player:GossipComplete()
    end
    
    if (intid == 13379) and (player:GetItemCount(38186) < 50) then
    			player:SendAreaTriggerMessage("You need 50 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 50)
    			player:AddItem( 20558, 5)
    			player:GossipComplete()
    end
    
    if (intid == 133710) and (player:GetItemCount(38186) < 500) then
    			player:SendAreaTriggerMessage("You need 500 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 500)
    			player:AddItem( 33225, 1)
    			player:GossipComplete()
    end
    
    if (intid == 133711) and (player:GetItemCount(38186) < 250) then
    			player:SendAreaTriggerMessage("You need 250 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 250)
    			player:AddItem( 33079, 1)
    			player:GossipComplete()
    end
    
    if (intid == 133712) and (player:GetItemCount(38186) < 100) then
    			player:SendAreaTriggerMessage("You need 100 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 100)
    			player:AddItem( 34480, 1)
    			player:GossipComplete()
    end
    end
    
    RegisterUnitGossipEvent(5009010, 1, "On_Gossip_Menu")
    RegisterUnitGossipEvent(5009010, 2, "On_Gossip_Menu_select")

    Halp please lua script not working
  2. #2
    Pretzal's Avatar Member
    Reputation
    8
    Join Date
    Aug 2008
    Posts
    57
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Commented out the very first END function - You might have to add another down the bottem though.
    havent tested this, its just a hunch

    Also:
    if (intid == 13371) and (player:GetItemCount(19712) < 1) then
    player:SendAreaTriggerMessage("You need 1 Purple Bijou for this item!!")
    player:GossipComplete()
    else
    player:RemoveItem(19712, 1)
    player:AddItem( 38186, 1)
    player:GossipComplete()
    end
    if intid = 13371 AND item 19712 < 1 it sends you a message.
    The else might be wrong there, the else will operate IF the intid is NOT 13371 i think.
    you might want something like
    if intid == x
    if playergetcount item id < 1
    send message
    else
    give item/remove item/complete gossip

    ^ Thats roughly how i think it would go... Im no genius at this though. i could be very off.


    Code:
    local npcid = 5009010
    
    function On_Gossip_Menu(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(9, "Bijou's into Ethereal Credits!", 1, 0)
    unit:GossipMenuAddItem(9, "Ethereal credit exchange store.", 2, 0)
    unit:GossipMenuAddItem(9, "Sell your items for Ethereal Credit!", 3, 0)
    unit:GossipSendMenu(player)
    -- end commenting out the end here.  See if it works, it might.
    
    function On_Gossip_Menu_select(Unit, event, player, id, intid, code)
    if (intid == 1) then
    Unit:GossipCreateMenu(99, player, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X1", 13371, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X3", 13372, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X5", 13373, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X10", 13374, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X20", 13375, 0)
    Unit:GossipMenuAddItem(2, "|cFF008000Ethereal Credit X50", 13376, 0)
    Unit:GossipSendMenu(player)
    end
    
    if (intid == 2) then
    Unit:GossipCreateMenu(98, player, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Warsong gulch marks X1 for 10 Credits", 13377, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Warsong gulch marks X3 for 30 Credits", 13378, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Warsong gulch marks X5 for 50 Credits", 13379, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Swift Spectral Tiger for 500 Credits", 133710, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Murloc Suit for 250 Credits", 133711, 0)
    Unit:GossipMenuAddItem(2, "|cffffff00Picnic Basket for 100 Credits", 133712, 0)
    Unit:GossipSendMenu(player)
    end
    
    
    if (intid == 3) then
    Unit:GossipCreateMenu(97, player, 0)
    unit:GossipMenuAddItem(0, "|cFFFFD700!Coming Soon!", 21, 0)
    Unit:GossipSendMenu(player)
    end
    
    if (intid == 13371) and (player:GetItemCount(19712) < 1) then
    			player:SendAreaTriggerMessage("You need 1 Purple Bijou for this item!!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 1)
    			player:AddItem( 38186, 1)
    			player:GossipComplete()
    end
    
    if (intid == 13372) and (player:GetItemCount(19712) < 3) then
    			player:SendAreaTriggerMessage("You need 3 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 3)
    			player:AddItem( 38186, 3)
    			player:GossipComplete()
    end
    
    if (intid == 13373) and (player:GetItemCount(19712) < 5) then
    			player:SendAreaTriggerMessage("You need 5 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 5)
    			player:AddItem( 38186, 5)
    			player:GossipComplete()
    end
    
    if (intid == 13374) and (player:GetItemCount(19712) < 10) then
    			player:SendAreaTriggerMessage("You need 10 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 10)
    			player:AddItem( 38186, 10)
    			player:GossipComplete()
    end
    
    if (intid == 13375) and (player:GetItemCount(19712) < 20) then
    			player:SendAreaTriggerMessage("You need 20 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 20)
    			player:AddItem( 38186, 20)
    			player:GossipComplete()
    end
    
    if (intid == 13376) and (player:GetItemCount(19712) < 50) then
    			player:SendAreaTriggerMessage("You need 50 Purple Bijou for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(19712, 50)
    			player:AddItem( 38186, 1)
    			player:GossipComplete()
    end
    
    if (intid == 13377) and (player:GetItemCount(38186) < 10) then
    			player:SendAreaTriggerMessage("You need 10 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 10)
    			player:AddItem( 20558, 1)
    			player:GossipComplete()
    end
    
    if (intid == 13378) and (player:GetItemCount(38186) < 30) then
    			player:SendAreaTriggerMessage("You need 30 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 30)
    			player:AddItem( 20558, 3)
    			player:GossipComplete()
    end
    
    if (intid == 13379) and (player:GetItemCount(38186) < 50) then
    			player:SendAreaTriggerMessage("You need 50 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 50)
    			player:AddItem( 20558, 5)
    			player:GossipComplete()
    end
    
    if (intid == 133710) and (player:GetItemCount(38186) < 500) then
    			player:SendAreaTriggerMessage("You need 500 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 500)
    			player:AddItem( 33225, 1)
    			player:GossipComplete()
    end
    
    if (intid == 133711) and (player:GetItemCount(38186) < 250) then
    			player:SendAreaTriggerMessage("You need 250 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 250)
    			player:AddItem( 33079, 1)
    			player:GossipComplete()
    end
    
    if (intid == 133712) and (player:GetItemCount(38186) < 100) then
    			player:SendAreaTriggerMessage("You need 100 Ethereal Credits for this item!")
    			player:GossipComplete()
    		else
    			player:RemoveItem(38186, 100)
    			player:AddItem( 34480, 1)
    			player:GossipComplete()
    end
    end
    -- You mgiht have to add another end here.
    
    RegisterUnitGossipEvent(5009010, 1, "On_Gossip_Menu")
    RegisterUnitGossipEvent(5009010, 2, "On_Gossip_Menu_select")
    Last edited by Pretzal; 09-26-2009 at 10:56 PM.

  3. #3
    thebigman's Avatar Contributor Reliable Trader
    CoreCoins Purchaser
    Reputation
    89
    Join Date
    Dec 2008
    Posts
    605
    Thanks G/R
    2/0
    Trade Feedback
    26 (96%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    looks good, gonna test it, thanks.

  4. #4
    thebigman's Avatar Contributor Reliable Trader
    CoreCoins Purchaser
    Reputation
    89
    Join Date
    Dec 2008
    Posts
    605
    Thanks G/R
    2/0
    Trade Feedback
    26 (96%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok awesome, all 3 first menu things work, but they still grant all the rewards without even GOING to a submenu. And the nil check was ignored AGAIN.

  5. #5
    Gastricpenguin's Avatar Legendary
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function On_Gossip_Menu(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(9, "Bijou's into Ethereal Credits!", 1, 0)
    unit:GossipMenuAddItem(9, "Ethereal credit exchange store.", 2, 0)
    unit:GossipMenuAddItem(9, "Sell your items for Ethereal Credit!", 3, 0)
    unit:GossipSendMenu(player)
    -- end commenting out the end here. See if it works, it might.

    If you remove the "end", your function never stops, i.e. terrible syntax.

Similar Threads

  1. [Lua Script] Lua Script Not Working
    By drpwnage77 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 06-23-2010, 05:50 PM
  2. LUA script not working
    By Dz The Rage in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 04-04-2009, 09:26 PM
  3. LUA script not working
    By pedobear123 in forum World of Warcraft General
    Replies: 12
    Last Post: 09-01-2008, 09:38 AM
  4. [Help] Lua Script Not Working
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 26
    Last Post: 03-16-2008, 02:13 PM
  5. Simple Lua Script , not working need help!
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 12-30-2007, 02:06 PM
All times are GMT -5. The time now is 04:56 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