LUA help menu

User Tag List

Thread: LUA help

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

    LUA help

    When making a custom gossip npc, that adds and deletes spells, I finally made the script and it all worked except:

    When you choose an option, It doesnt do what it is supposed, does nothing.

    Also it says this above the option menu:

    ID:70 is a bad Worldstring TEXT!

    help? heres a copy of the lua. I dont think theres anything wrong with it though.



    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, "Remove Rezz Sickness", 1, 0)
    unit:GossipMenuAddItem(2, "Remove Deserter", 3, 0)
    unit:GossipMenuAddItem(2, "Add Master Hammersmith", 4, 0)
    unit:GossipMenuAddItem(2, "Add Master Swordsmith", 5, 0)
    unit:GossipMenuAddItem(2, "Add Master Axesmith", 6, 0)
    unit:GossipMenuAddItem(2, "Add Goblin Engineering", 7, 0)
    unit:GossipMenuAddItem(2, "Add Gnomish Engineering", 8, 0 )
    unit:GossipMenuAddItem(2, "Made by Furious / Armageddon of WoW-Hazzard", 999, 3)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    end
    
    if(intid == 3544) then
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, "Remove Rezz Sickness", 1, 0)
    unit:GossipMenuAddItem(2, "Remove Coward", 3, 0)
    unit:GossipMenuAddItem(2, "Add Master Hammersmith", 4, 0)
    unit:GossipMenuAddItem(2, "Add Master Swordsmith", 5, 0)
    unit:GossipMenuAddItem(2, "Add Master Axesmith", 6, 0)
    unit:GossipMenuAddItem(2, "Add Goblin Engineering", 7, 0)
    unit:GossipMenuAddItem(2, "Add Gnomish Engineering", 8, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 1) then
    player:LearnSpell(15007)
    player:UnlearnSpell(15007)
    end
    
    if(intid == 3) then
    player:LearnSpell(26013)
    player:UnlearnSpell(26013)
    end
    
    if(intid == 4) then
    player:LearnSpell(17040)
    player:UnlearnSpell(17041)
    player:UnlearnSpell(17039)
    end
    
    if(intid == 5) then
    player:LearnSpell(17039)
    player:UnlearnSpell(17040)
    player:UnlearnSpell(17041)
    end
    
    if(intid == 6) then
    player:LearnSpell(17041)
    player:UnlearnSpell(17040)
    player:UnlearnSpell(17039)
    end
    
    if(intid == 7) then
    player:LearnSpell(20221)
    player:UnlearnSpell(20220)
    end
    
    if(intid == 8) then
    player:LearnSpell(20220)
    player:UnlearnSpell(20221)
    end
    end
    
    RegisterUnitGossipEvent(555555, 1, "On_Gossip")
    RegisterUnitGossipEvent(555555, 2, "Gossip_Submenus")

    LUA help
  2. #2
    bigjohnson4's Avatar Member
    Reputation
    12
    Join Date
    Mar 2007
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function Gossip_Submenus(unit, event, player, id, intid, code)
    end

    Don't end the function before you even start it...

  3. #3
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to use a unique ID everytime: so you cant use:

    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, "Remove Rezz Sickness", 1, 0)
    unit:GossipMenuAddItem(2, "Remove Deserter", 3, 0)
    unit:GossipMenuAddItem(2, "Add Master Hammersmith", 4, 0)
    unit:GossipMenuAddItem(2, "Add Master Swordsmith", 5, 0)
    unit:GossipMenuAddItem(2, "Add Master Axesmith", 6, 0)
    unit:GossipMenuAddItem(2, "Add Goblin Engineering", 7, 0)
    unit:GossipMenuAddItem(2, "Add Gnomish Engineering", 8, 0 )
    unit:GossipMenuAddItem(2, "Made by Furious / Armageddon of WoW-Hazzard", 999, 3)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    end
    
    if(intid == 3544) then
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, "Remove Rezz Sickness", 1, 0)
    unit:GossipMenuAddItem(2, "Remove Coward", 3, 0)
    unit:GossipMenuAddItem(2, "Add Master Hammersmith", 4, 0)
    unit:GossipMenuAddItem(2, "Add Master Swordsmith", 5, 0)
    unit:GossipMenuAddItem(2, "Add Master Axesmith", 6, 0)
    unit:GossipMenuAddItem(2, "Add Goblin Engineering", 7, 0)
    unit:GossipMenuAddItem(2, "Add Gnomish Engineering", 8, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 1) then
    player:LearnSpell(15007)
    player:UnlearnSpell(15007)
    end
    
    if(intid == 3) then
    player:LearnSpell(26013)
    player:UnlearnSpell(26013)
    end
    
    if(intid == 4) then
    player:LearnSpell(17040)
    player:UnlearnSpell(17041)
    player:UnlearnSpell(17039)
    end
    
    if(intid == 5) then
    player:LearnSpell(17039)
    player:UnlearnSpell(17040)
    player:UnlearnSpell(17041)
    end
    
    if(intid == 6) then
    player:LearnSpell(17041)
    player:UnlearnSpell(17040)
    player:UnlearnSpell(17039)
    end
    
    if(intid == 7) then
    player:LearnSpell(20221)
    player:UnlearnSpell(20220)
    end
    
    if(intid == 8) then
    player:LearnSpell(20220)
    player:UnlearnSpell(20221)
    end
    end
    
    RegisterUnitGossipEvent(555555, 1, "On_Gossip")
    RegisterUnitGossipEvent(555555, 2, "Gossip_Submenus")
    from where did you get the 3544?
    You need one of the red numbers at the position from the 3544.
    Last edited by Kaidos; 08-13-2009 at 07:12 AM.

  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)
    There is a unique id per each one. Any help from the ID:70 wise part? apparently that doesnt work even with a reloaded worldstring

  5. #5
    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)
    Originally Posted by bigjohnson4 View Post
    Don't end the function before you even start it...
    If i Dont have an end there the script doesnt work AT ALL and logonserver says it needed an "end" at line 14, which is that line.

    edit: shit nvm that was one of the problems, so i added an extra end to the bottom and its ok now.
    Last edited by thebigman; 08-13-2009 at 11:41 AM.

  6. #6
    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 so the npc works now but the text on it still bothers me, it used to say how can I help you N$? now it says

    ID:70 is a bad worldstring TEXT

    how do i rid myself of that? it looks tacky.

  7. #7
    jay77's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Repost the entire script, I'll take a look at it.

  8. #8
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    EDIT: Nvm, seems you already fixed your problem with the script
    Last edited by Sounddead; 08-13-2009 at 06:56 PM.

    I live in a shoe

  9. #9
    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)
    yea, now all i need is an sql fix ><

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 07:01 PM. 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