LUA Script Help menu

User Tag List

Results 1 to 8 of 8
  1. #1
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Script Help

    I want npcid to spawn npcidtwo and then for npcidtwo to walk to the specific place. But when i talk with the npcid npc theres no menu. What have i done wrong?
    Code:
    local npcid = 939373
    local npcidtwo = 99901
    
    print ("                -                 ")
    print (" This Script was made by P1raten. ")
    print ("    Report bugs to mmowned.com    ")
    print ("                -                 ")
    
    function ggStart_OnGossipTalk(pUnit, event, player, pMisc)
       pUnit:GossipCreateMenu(50, player, 0)
       pUnit:GossipMenuAddItem(9, "Start tour.", 1, 0)
       pUnit:GossipMenuAddItem(0, "I dont need a guide.", 2, 0)
       pUnit:GossipSendMenu(player)
    end
    function ggStart_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
    if (intid == 1) then
       pUnit:SendChatMessage("Welcome to DifferentWoW.")
       pUnit:CastSpell(35341)
       x = pUnit:GetX();
       y = pUnit:GetY();
       z = pUnit:GetZ();
       o = pUnit:GetO();
       pUnit:SpawnCreature(99901, x, y, z, o, 35, 0);
       pUnit:GossipComplete(player)
    end
    if (intid == 2) then
       pUnit:GossipComplete(player)
       player:SendChatMessage("Fine.")
    end
    end
    
    RegisterUnitGossipEvent(npcid, 1, "ggStart_OnGossipTalk")
    RegisterUnitGossipEvent(npcid, 2, "ggStart_OnGossipSelect")
    
    function ggGuide_OnGossipTalk(pUnit, event, player, pMisc)
       pUnit:GossipCreateMenu(50, player, 0)
       pUnit:GossipMenuAddItem(9, "Lets Go.", 3, 0)
       pUnit:GossipSendMenu(player)
    end
    
    if (intid == 3) then
       pUnit:SendChatMessage("Let's go then.")
       pUnit:MoveTo(1874.164917, 238.025650, 62.275116, 0.007061)
       pUnit:GossipComplete(player)
    end
    end
    
    RegisterUnitGossipEvent(npcidtwo, 3, "ggGuide_OnGossipTalk")
    RegisterUnitGossipEvent(npcidtwo, 4, "ggGuide_OnGossipSelect")

    LUA Script Help
  2. #2
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No help at all? Cmon guys .

  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)
    Hi,

    Is there any error in the arcemu-world.exe?

    Npcflags on 1 ?

    Edit: Try this

    Code:
    local npcid = 939373
    local npcidtwo = 99901
    
    print ("                -                 ")
    print (" This Script was made by P1raten. ")
    print ("    Report bugs to mmowned.com    ")
    print ("                -                 ")
    
    ----------------------
    
    function ggStart_OnGossipStart(pUnit, Event)
       ggStart_OnGossipTalk(pUnit, player)
    end
    
    function ggGuide_OnGossipStart(pUnit, Event)
       ggGuide_OnGossipTalk(pUnit, player)
    end
    
    -----------------------
    
    function ggStart_OnGossipTalk(pUnit, event, player, pMisc)
       pUnit:GossipCreateMenu(50, player, 0)
       pUnit:GossipMenuAddItem(9, "Start tour.", 1, 0)
       pUnit:GossipMenuAddItem(0, "I dont need a guide.", 2, 0)
       pUnit:GossipSendMenu(player)
    end
    function ggStart_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
    if (intid == 1) then
       pUnit:SendChatMessage("Welcome to DifferentWoW.")
       pUnit:CastSpell(35341)
       x = pUnit:GetX();
       y = pUnit:GetY();
       z = pUnit:GetZ();
       o = pUnit:GetO();
       pUnit:SpawnCreature(99901, x, y, z, o, 35, 0);
       pUnit:GossipComplete(player)
    end
    if (intid == 2) then
       pUnit:GossipComplete(player)
       player:SendChatMessage("Fine.")
    end
    end
    
    RegisterUnitGossipEvent(npcid, 1, "ggStart_OnGossipStart")   --  changed
    RegisterUnitGossipEvent(npcid, 2, "ggStart_OnGossipSelect")
    
    function ggGuide_OnGossipTalk(pUnit, event, player, pMisc)
       pUnit:GossipCreateMenu(50, player, 0)
       pUnit:GossipMenuAddItem(9, "Lets Go.", 3, 0)
       pUnit:GossipSendMenu(player)
    end
    
    if (intid == 3) then
       pUnit:SendChatMessage("Let's go then.")
       pUnit:MoveTo(1874.164917, 238.025650, 62.275116, 0.007061)
       pUnit:GossipComplete(player)
    end
    end
    
    RegisterUnitGossipEvent(npcidtwo, 3, "ggGuide_OnGossipStart")  -- changed
    RegisterUnitGossipEvent(npcidtwo, 4, "ggGuide_OnGossipSelect")
    Last edited by Kaidos; 03-15-2009 at 09:14 AM.

  4. #4
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx, ill see if it works.

  5. #5
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Code:
    local npcid = 939373
    local npcidtwo = 99901
    
    print ("                -                 ")
    print (" This Script was made by P1raten. ")
    print ("    Report bugs to mmowned.com    ")
    print ("                -                 ")
    
    function ggStart_OnGossipTalk(pUnit, event, player, pMisc)
       pUnit:GossipCreateMenu(6031, player, 0)
       pUnit:GossipMenuAddItem(9, "Start tour.", 1, 0)
       pUnit:GossipMenuAddItem(0, "I dont need a guide.", 2, 0)
       pUnit:GossipSendMenu(player)
    end
    function ggStart_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
    if (intid == 1) then
       pUnit:SendBroadcastMessage("Welcome to DifferentWoW.")
       pUnit:CastSpell(35341)
       x = pUnit:GetX();
       y = pUnit:GetY();
       z = pUnit:GetZ();
       o = pUnit:GetO();
       pUnit:SpawnCreature(99901, x, y, z, o, 35, 0);
       pUnit:GossipComplete(player)
    end
    if (intid == 2) then
       pUnit:GossipComplete(player)
       player:SendBroadcastMessage("Fine.")
    end
    end
    
    RegisterUnitGossipEvent(npcid, 1, "ggStart_OnGossipTalk")
    RegisterUnitGossipEvent(npcid, 2, "ggStart_OnGossipSelect")

    Code:
    function agggGuide_OnGossipTalk(pUnit, event, player, pMisc)
       pUnit:GossipCreateMenu(5015, player, 0)
       pUnit:GossipMenuAddItem(9, "Lets Go.", 3, 0)
       pUnit:GossipMenuAddItem(1, "Do nothing.", 4, 0)
       pUnit:GossipSendMenu(player)
    end
    
    function agggStart_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
    if (intid == 3) then
       pUnit:SendBroadcastMessage("Let's go then.")
       pUnit:MoveTo(1874.164917, 238.025650, 62.275116, 0.007061)
       pUnit:GossipComplete(player)
    end
    if (intid == 4) then
       pUnit:GossipComplete(player)
    end
    end
    
    RegisterUnitGossipEvent(npcidtwo, 3, "agggGuide_OnGossipTalk")  -- changed
    RegisterUnitGossipEvent(npcidtwo, 4, "agggGuide_OnGossipSelect")

    Fixed up loads of bugs, you had start when you registered talk, and each gossip create has to be a different id.
    SendChatMessage syntex is wrong, i've changed it to broadcast as that should work. pUnit:SendChatMessage(12,0,"") or something for the other one.

    The one posted above me wont work i'm afraid (sorry).

  6. #6
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx for that stoneharry. +rep

    EDIT: Didnt work. :S
    Last edited by P1raten; 03-15-2009 at 07:09 PM.

  7. #7
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Tell me the error in console you are getting, if your getting no error at all then it's a program with your Lua scripting engine.
    I can help you faster if you talk to me on msn, chatting through posts can take a while [email protected]

  8. #8
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, ill add you when i get home. Im at a friends house atm.

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 08:04 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