[Lua] My Teleporter NPC... menu

User Tag List

Results 1 to 12 of 12
  1. #1
    davidknag's Avatar Active Member
    Reputation
    49
    Join Date
    Nov 2009
    Posts
    201
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] My Teleporter NPC...

    Ok I was doing my first LUA Script and I thought that I was all done, so I went into game to test out my npc...
    he just says
    Code:
    Hey There, (Player Name). How can I help you?
    Heres the LUA Code:

    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, GM Locations!,1,0)
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    if(intid == 1) then 
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(2, GM Island,2,0)
    unit:GossipMenuAddItem(2, Hyjal,3,0)
    unit:GossipMenuAddItem(2, Second GM Island,4,0)
    unit:GossipMenuAddItem(2, Atlantis,5,0)
    unit:GossipMenuAddItem(2, Old Ironforge,6,0)
    unit:GossipMenuAddItem(2, Emerald Dream,7,0)
    unit:GossipMenuAddItem(2, Staircase Mall,8,0)
    
    if(intid ==2) then
    player:Teleport(1,16215,16269,14)
    unit:GossipComplete(player)
    end
    
    if(intid ==3) then
    player:Teleport(1,4654,-3772,944)
    unit:GossipComplete(player)
    end
    
    if(intid ==4) then
    player:Teleport(1,10735,2467,7)
    unit:GossipComplete(player)
    end
    
    if(intid ==5) then
    player:Teleport(1,-9619,-5594,-496)
    unit:GossipComplete(player)
    end
    
    if(intid ==6) then
    player:Teleport(0,-4818,-973,465)
    unit:GossipComplete(player)
    end
    
    if(intid ==7) then
    player:Teleport(169,2732.93,-3319.63,101.284)
    unit:GossipComplete(player)
    end
    
    if(intid ==8) then
    player:Teleport(0,-1852,-4145,11)
    unit:GossipComplete(player)
    end
    
    RegisterUnitGossipEvent(400036,1,On_Gossip)
    RegisterUnitGossipEvent(400036,2,Gossip_Submenus)
    Any errors in that?

    well, if not, here is the SQL Query:
    Code:
    insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `leader`) 
    values ('400036', "Cool Places", "Teleporter", '', '0', '7', '0', '0', '25754', '0', '0', '0', '1', '1', '0');
    
    insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`) 
    values ('400036', '255', '255', '35', '1337', '1337', '1337', '1', '1', '1337', '0', '1337', '1337', '0', '0', '0', '0', '0', '1337', '0', '0', '0', '0', '0', '0', '0', '0', "0", '0', '0', '0', '0', '2.50', '8.00', '14.00', '0', '0', '0', '0', '0', '0', '0');
    Thank You!
    David

    [Lua] My Teleporter NPC...
  2. #2
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On your gossip menu you forgot to send the menu to the player.
    You need to add unit:GossipSendMenu(player) after the "GM Locations" on the Gossip Function. Same for the if(intid == 1)
    You also need a end at the bottom of the first function and the second function to close them.

  3. #3
    davidknag's Avatar Active Member
    Reputation
    49
    Join Date
    Nov 2009
    Posts
    201
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ground Zero View Post
    On your gossip menu you forgot to send the menu to the player.
    You need to add unit:GossipSendMenu(player) after the "GM Locations" on the Gossip Function. Same for the if(intid == 1)
    You also need a end at the bottom of the first function and the second function to close them.
    Could you please show me the code as it is fixed?
    I am still learning saying that this is my first LUA Script and I dont get the adding "end" and the first function and second function

  4. #4
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, GM Locations!,1,0)
    unit:GossipSendMenu(player)
    end



    function Gossip_Submenus(unit, event, player, id, intid, code)

    if(intid == 1) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(2, GM Island,2,0)
    unit:GossipMenuAddItem(2, Hyjal,3,0)
    unit:GossipMenuAddItem(2, Second GM Island,4,0)
    unit:GossipMenuAddItem(2, Atlantis,5,0)
    unit:GossipMenuAddItem(2, Old Ironforge,6,0)
    unit:GossipMenuAddItem(2, Emerald Dream,7,0)
    unit:GossipMenuAddItem(2, Staircase Mall,8,0)
    unit:GossipSendMenu(player)
    end

    end (the last end is to finish the function GossipSubmenus)


  5. #5
    davidknag's Avatar Active Member
    Reputation
    49
    Join Date
    Nov 2009
    Posts
    201
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ground Zero View Post
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, GM Locations!,1,0)
    unit:GossipSendMenu(player)
    end



    function Gossip_Submenus(unit, event, player, id, intid, code)

    if(intid == 1) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(2, GM Island,2,0)
    unit:GossipMenuAddItem(2, Hyjal,3,0)
    unit:GossipMenuAddItem(2, Second GM Island,4,0)
    unit:GossipMenuAddItem(2, Atlantis,5,0)
    unit:GossipMenuAddItem(2, Old Ironforge,6,0)
    unit:GossipMenuAddItem(2, Emerald Dream,7,0)
    unit:GossipMenuAddItem(2, Staircase Mall,8,0)
    unit:GossipSendMenu(player)
    end

    end (the last end is to finish the function GossipSubmenus)

    Still Not working

  6. #6
    davidknag's Avatar Active Member
    Reputation
    49
    Join Date
    Nov 2009
    Posts
    201
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ohhh wait when i boot up my world file it gives this...


  7. #7
    davidknag's Avatar Active Member
    Reputation
    49
    Join Date
    Nov 2009
    Posts
    201
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bump xD xP lol

  8. #8
    Kiev's Avatar Contributor
    Reputation
    288
    Join Date
    Nov 2007
    Posts
    1,819
    Thanks G/R
    0/4
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Line 1 = The first line.

    Unexpected symbol near n = o or _

    Which shouldn't bring a error o.o?




  9. #9
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Show us your script now, just the first 5 lines please.

  10. #10
    davidknag's Avatar Active Member
    Reputation
    49
    Join Date
    Nov 2009
    Posts
    201
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
     function OnGossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, GM Locations!,1,0)
    unit:GossipSendMenu(player)
    end

  11. #11
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried removing the space before function?

  12. #12
    davidknag's Avatar Active Member
    Reputation
    49
    Join Date
    Nov 2009
    Posts
    201
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ground Zero View Post
    Have you tried removing the space before function?
    ooh that was a problem when i put it on the "{code}"
    Last edited by davidknag; 02-27-2010 at 06:25 PM.

Similar Threads

  1. [Lua Guide] Teleport NPC
    By DarkFever in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 09-04-2009, 11:42 AM
  2. [Release] Fun Teleporter npc [Lua++]
    By stoneharry in forum WoW EMU General Releases
    Replies: 24
    Last Post: 02-23-2009, 06:48 PM
  3. [Release] Teleporter NPC (LUA++)
    By Vaudville in forum WoW EMU General Releases
    Replies: 9
    Last Post: 09-23-2008, 09:55 AM
  4. Teleporter NPC LUA
    By Performer in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 08-21-2008, 08:04 AM
  5. Will this teleporter npc lua script work?
    By Bapes in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 05-22-2008, 11:50 AM
All times are GMT -5. The time now is 04:26 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