LUA Script help menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    silentghost's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Script help

    I have copied this script from another website and filled in the NPC ids, but when i try to speak to the NPC nothing happens.

    Code:
    function On_Gossip(pUnit, event, player)
    pUnit:GossipCreateMenu(100, player)
    pUnit:GossipMenuAddItem(player, 0, "Horde Cities", 1, 0)
    pUnit:GossipMenuAddItem(player, 0, "Alliance Cities", 2, 0)
    pUnit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(pUnit, event, player, id, intid, code)
    if(intid == 1) then
    pUnit:GossipGossipMenuAddItem(99, player)
    pUnit:GossipMenuAddItem(player, 5, "Orgrimmar", 10, 0)
    pUnit:GossipMenuAddItem(player, 5, "Undercity", 11, 0)
    pUnit:GossipMenuAddItem(player, 5, "Thunder Bluff", 12, 0)
    pUnit:GossipMenuAddItem(player, 5, "Silvermoon", 13, 0)
    pUnit:GossipMenuAddItem(player, 5, "[Back]", 50, 0)
    pUnit:GossipSendMenu 
    end
    if(intid == 2) then
    pUnit:GossipCreateMenu(99, player)
    pUnit:GossipMenuAddItem(player, 5, "Stormwind", 14, 0)
    pUnit:GossipMenuAddItem(player, 5, "Ironforge", 15, 0)
    pUnit:GossipMenuAddItem(player, 5, "Darnassus", 16, 0)
    pUnit:GossipMenuAddItem(player, 5, "Exodar", 17, 0)
    pUnit:GossipMenuAddItem(player, 5, "[Back]", 50, 0)
    pUnit:MenuSendToPlayer(player)
    end 
    if(intid == 10) then
    player:Teleport(1, 1502.709961, -4415.419922, 21.552401)
    end 
    if(intid == 11) then
    player:Teleport(0, 1641.975708, 239.871552, 62.592873)
    end 
    if(intid == 12) then
    player:Teleport(1, -1278.849609, 126.752800, 131.329880)
    end 
    if(intid == 13) then
    player:Teleport(530, 9414.009766, -7278.341797, 14.201572)
    end 
    if(intid == 14) then
    player:Teleport(0, -8908.250000, 558.204956, 93.432388)
    end 
    if(intid == 15) then
    player:Teleport(0, -4925.266602, -951.037842, 501.551971)
    end 
    if(intid == 16) then
    player:Teleport(1, 9952.001953, 2280.712891, 1341.393921)
    end 
    if(intid == 17) then
    player:Teleport(530, -3992.824951, -11858.342773, 0.297733)
    end 
    
    RegisterGossipEvent(200001, 1, "On_Gossip")
    RegisterGossipEvent(200001, 2, "Gossip_Submenus")
    this is my first real try at LUA so any help would be appreciated

    LUA Script help
  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)
    Did u fill in the correct NPC flags in the Creature_proto table?

  3. #3
    silentghost's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i guess not lol, what do i have to do?

  4. #4
    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)
    take a look at http://www.mmowned.com/forums/emulat...ery-handy.html
    it has all the NPC flags

    but for now in your case just go to the Creature_proto table in your database and in the column npcflags write 1

  5. #5
    silentghost's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ahhh thats why! i put it in creature _names i think, anyway thank. +rep

  6. #6
    silentghost's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, i looked and the flags are already at 1 what do i do?

  7. #7
    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)
    hm can u wait for like half an hour? i'm currently busy with some irl stuff and i'll be done in ~30 mins so i'll take a more indepth look onit

    for now try setting it to flag 27

  8. #8
    silentghost's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks alot man

  9. #9
    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)
    Originally Posted by silentghost View Post
    thanks alot man
    Try this, did it out of the back of my head so might not work.
    Code:
     local npcid = 200001
    
    function On_Gossip(pUnit, event, player)
    	pUnit:GossipCreateMenu(100, player, 0)
    	pUnit:GossipMenuAddItem(0, "Horde Cities", 1, 0)
    	pUnit:GossipMenuAddItem(0, "Alliance Cities", 2, 0)
    	pUnit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(pUnit, event, player, id, intid, code)
    if(intid == 1) then
    	pUnit:GossipCreateMenu(99, player, 0)
    	pUnit:GossipMenuAddItem(5, "Orgrimmar", 10, 0)
    	pUnit:GossipMenuAddItem(5, "Undercity", 11, 0)
    	pUnit:GossipMenuAddItem(5, "Thunder Bluff", 12, 0)
    	pUnit:GossipMenuAddItem(5, "Silvermoon", 13, 0)
    	pUnit:GossipMenuAddItem(5, "[Back]", 50, 0)
    	pUnit:GossipSendMenu(player)
    end
    end
    
    if(intid == 2) then
    	pUnit:GossipCreateMenu(99, player, 0)
    	pUnit:GossipMenuAddItem(5, "Stormwind", 14, 0)
    	pUnit:GossipMenuAddItem(5, "Ironforge", 15, 0)
    	pUnit:GossipMenuAddItem(5, "Darnassus", 16, 0)
    	pUnit:GossipMenuAddItem(5, "Exodar", 17, 0)
    	pUnit:GossipMenuAddItem(5, "[Back]", 50, 0)
    	pUnit:MenuSendToPlayer(player)
    end 
    if(intid == 10) then
    	player:Teleport(1, 1502.709961, -4415.419922, 21.552401)
    end 
    if(intid == 11) then
    	player:Teleport(0, 1641.975708, 239.871552, 62.592873)
    end 
    if(intid == 12) then
    	player:Teleport(1, -1278.849609, 126.752800, 131.329880)
    end 
    if(intid == 13) then
    	player:Teleport(530, 9414.009766, -7278.341797, 14.201572)
    end 
    if(intid == 14) then
    	player:Teleport(0, -8908.250000, 558.204956, 93.432388)
    end 
    if(intid == 15) then
    	player:Teleport(0, -4925.266602, -951.037842, 501.551971)
    end 
    if(intid == 16) then
    	player:Teleport(1, 9952.001953, 2280.712891, 1341.393921)
    end 
    if(intid == 17) then
    	player:Teleport(530, -3992.824951, -11858.342773, 0.297733)
    end 
    
    RegisterUnitGossipEvent(200001,1,"On_Gossip")
    RegisterUnitGossipEvent(200001,2,"Gossip_Submenus")

  10. #10
    silentghost's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok i tried yours and nothing has changed,
    - the script is in the right place
    -its saved as .lua
    -Npc spawn is right
    Last edited by silentghost; 09-29-2008 at 02:56 PM.

  11. #11
    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)
    Did u compile the right stuff?:x

  12. #12
    silentghost's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what do you mean?

  13. #13
    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)
    here take a look at this: Board Message

    You might have to register an account

  14. #14
    silentghost's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what so everytime i create an LUA i ahev to compile it?

  15. #15
    silentghost's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a guide on how to create and use LUA scripts?

Page 1 of 2 12 LastLast

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:46 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