[LUA] Teleporter Issue menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    Evilbuffy's Avatar Member
    Reputation
    38
    Join Date
    Mar 2009
    Posts
    185
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] Teleporter Issue

    function On_Gossip(pUnit, event, player)
    local race=player:GetPlayerRace()
    if race==1 or race==3 or race==4 or race==7 or race==11 then
    pUnit:GossipCreateMenu(3544, player, 0)
    pUnit:GossipMenuAddItem(2, "Alliance Leveling Areas", 1, 0)
    pUnit:GossipMenuAddItem(2, "Custom Instances", 3, 0)
    pUnit:GossipSendMenu(player)

    else
    pUnit:GossipCreateMenu(3544, player, 0)
    pUnit:GossipMenuAddItem(2, "Horde Leveling Areas", 2, 0)
    pUnit:GossipMenuAddItem(2, "Custom Instances", 3, 0)
    pUnit:GossipSendMenu(player)
    end
    end

    function Gossip_Submenus(pUnit, event, player, id, intid, code)
    if(intid == 999) then
    pUnit:GossipCreateMenu(3543, player, 0)
    pUnit:GossipMenuAddItem(2, "Alliance Leveling Areas", 1, 0)
    pUnit:GossipMenuAddItem(2, "Horde Leveling Areas", 2, 0)
    pUnit:GossipMenuAddItem(2, "Custom Instances", 3, 0)
    pUnit:GossipSendMenu(player)
    end

    if(intid == 1) then
    pUnit:GossipCreateMenu(3543, player, 0)
    pUnit:GossipMenuAddItem(1, "No rests for the Holidays", 300, 0)
    pUnit:GossipMenuAddItem(1, "Haunted Forest", 301, 0)
    pUnit:GossipMenuAddItem(1, "Finders Forest", 302, 0)
    pUnit:GossipMenuAddItem(0, "[Back]", 999, 0)
    pUnit:GossipSendMenu(player)
    end

    if(intid == 2) then
    pUnit:GossipCreateMenu(3543, player, 0)
    pUnit:GossipMenuAddItem(1, "No rests for the Holidays", 303, 0)
    pUnit:GossipMenuAddItem(1, "Haunted Forest", 304, 0)
    pUnit:GossipMenuAddItem(1, "Finders Forest", 305, 0)
    pUnit:GossipMenuAddItem(0, "[Back]", 999, 0)
    pUnit:GossipSendMenu(player)
    end

    if(intid == 3) then
    pUnit:GossipCreateMenu(3543, player, 0)
    pUnit:GossipMenuAddItem(1, "Utgarde Keep", 306, 0)
    pUnit:GossipMenuAddItem(1, "Utgarde Pinnacle", 307, 0)
    pUnit:GossipMenuAddItem(1, "The Nexus", 308, 0)
    pUnit:GossipMenuAddItem(1, "Azjol-Nerub", 309, 0)
    pUnit:GossipMenuAddItem(1, "Ahn'kahet", 310, 0)
    pUnit:GossipMenuAddItem(1, "Halls of Lightning", 311, 0)
    pUnit:GossipMenuAddItem(0, "[Back]", 999, 0)
    pUnit:GossipSendMenu(player)
    end

    if(intid == 300) then --No rests for the Holidays
    player:Teleport(0, -4952.040039, 923.046021, 396.43798
    pUnit:GossipComplete(player)
    end

    if(intid == 301) then --Haunted Forest
    player:Teleport(0, -7186.313965, -282.150848, 60.214787)
    pUnit:GossipComplete(player)
    end

    if(intid == 302) then --Finders Forest
    player:Teleport(0, -7590.881348, 1257.607422, 136.364761)
    pUnit:GossipComplete(player)
    end

    if(intid == 303) then --No rests for the Holidays
    player:Teleport(0, -5152.333496, 1163.829590, 385.045410)
    pUnit:GossipComplete(player)
    end

    if(intid == 304) then --Haunted Forest
    player:Teleport(0, -7124.536133, -294.570343, 59.73954
    pUnit:GossipComplete(player)
    end

    if(intid == 305) then --Finders Forest
    player:Teleport(0, -7617.710449, 1414.320801, 151.082993)
    pUnit:GossipComplete(player)
    end


    if(intid == 306) then --Utgarde Keep
    player:Teleport(571, 1203.406982, -4864.382324, 41.248001)
    pUnit:GossipComplete(player)
    end

    if(intid == 307) then --Utgarde Pinnacle
    player:Teleport(571, 1269.920654, -4854.597168, 215.763885)
    pUnit:GossipComplete(player)
    end

    if(intid == 30 then --The Nexus
    player:Teleport(571, 3856.677490, 6983.687988, 86.094810)
    pUnit:GossipComplete(player)
    end

    if(intid == 309) then --Azjol-Nerub
    player:Teleport(571, 3721.598633, 2169.613525, 37.027439)
    pUnit:GossipComplete(player)
    end

    if(intid == 310) then --Ahn'kahet
    player:Teleport(571, 3653.818115, 2068.238525, 4.150550)
    pUnit:GossipComplete(player)
    end

    if(intid == 311) then --Halls of Lightning
    player:Teleport(571, 9082.833984, -1312.702759, 1058.398315)
    pUnit:GossipComplete(player)
    end
    end

    RegisterUnitGossipEvent(100255, 1, "On_Gossip")
    RegisterUnitGossipEvent(100255, 2, "Gossip_Submenus")
    The script above is the script for my teleporter. The teleporter works, and there is nothing wrong in that way. But as you can see, it's supposed to read if the player is alliance or horde, and then show menus for the faction they are. It does this, but when you press one of the menus it gives you and then press "Back", you can also see the menus for the opposite faction.

    Can anyone fix this? I will be deeply great full and of course give +Rep to anyone who can help me!

    [LUA] Teleporter Issue
  2. #2
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm. Maybe trying it like this.

    Code:
    function On_Gossip(pUnit, event, player)
    local race=player:GetPlayerRace()
    if race==1 or race==3 or race==4 or race==7 or race==11 then
    pUnit:GossipCreateMenu(3544, player, 0)
    pUnit:GossipMenuAddItem(2, "Alliance Leveling Areas", 1, 0)
    pUnit:GossipMenuAddItem(2, "Custom Instances", 3, 0)
    pUnit:GossipSendMenu(player)
    
    else
    pUnit:GossipCreateMenu(3544, player, 0)
    pUnit:GossipMenuAddItem(2, "Horde Leveling Areas", 2, 0)
    pUnit:GossipMenuAddItem(2, "Custom Instances", 3, 0)
    pUnit:GossipSendMenu(player)
    end
    end
    
    function Gossip_Submenus(pUnit, event, player, id, intid, code)
    if(intid == 999) then
    local race=player:GetPlayerRace()
    if race==1 or race==3 or race==4 or race==7 or race==11 then
    pUnit:GossipCreateMenu(3544, player, 0)
    pUnit:GossipMenuAddItem(2, "Alliance Leveling Areas", 1, 0)
    pUnit:GossipMenuAddItem(2, "Custom Instances", 3, 0)
    pUnit:GossipSendMenu(player)
    
    else
    pUnit:GossipCreateMenu(3544, player, 0)
    pUnit:GossipMenuAddItem(2, "Horde Leveling Areas", 2, 0)
    pUnit:GossipMenuAddItem(2, "Custom Instances", 3, 0)
    pUnit:GossipSendMenu(player)
    end
    end
    
    
    if(intid == 1) then
    pUnit:GossipCreateMenu(3543, player, 0)
    pUnit:GossipMenuAddItem(1, "No rests for the Holidays", 300, 0)
    pUnit:GossipMenuAddItem(1, "Haunted Forest", 301, 0)
    pUnit:GossipMenuAddItem(1, "Finders Forest", 302, 0)
    pUnit:GossipMenuAddItem(0, "[Back]", 999, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if(intid == 2) then
    pUnit:GossipCreateMenu(3543, player, 0)
    pUnit:GossipMenuAddItem(1, "No rests for the Holidays", 303, 0)
    pUnit:GossipMenuAddItem(1, "Haunted Forest", 304, 0)
    pUnit:GossipMenuAddItem(1, "Finders Forest", 305, 0)
    pUnit:GossipMenuAddItem(0, "[Back]", 999, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if(intid == 3) then
    pUnit:GossipCreateMenu(3543, player, 0)
    pUnit:GossipMenuAddItem(1, "Utgarde Keep", 306, 0)
    pUnit:GossipMenuAddItem(1, "Utgarde Pinnacle", 307, 0)
    pUnit:GossipMenuAddItem(1, "The Nexus", 308, 0)
    pUnit:GossipMenuAddItem(1, "Azjol-Nerub", 309, 0)
    pUnit:GossipMenuAddItem(1, "Ahn'kahet", 310, 0)
    pUnit:GossipMenuAddItem(1, "Halls of Lightning", 311, 0)
    pUnit:GossipMenuAddItem(0, "[Back]", 999, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if(intid == 300) then --No rests for the Holidays
    player:Teleport(0, -4952.040039, 923.046021, 396.437988)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 301) then --Haunted Forest
    player:Teleport(0, -7186.313965, -282.150848, 60.214787)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 302) then --Finders Forest
    player:Teleport(0, -7590.881348, 1257.607422, 136.364761)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 303) then --No rests for the Holidays
    player:Teleport(0, -5152.333496, 1163.829590, 385.045410)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 304) then --Haunted Forest
    player:Teleport(0, -7124.536133, -294.570343, 59.739548)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 305) then --Finders Forest
    player:Teleport(0, -7617.710449, 1414.320801, 151.082993)
    pUnit:GossipComplete(player)
    end
    
    
    if(intid == 306) then --Utgarde Keep
    player:Teleport(571, 1203.406982, -4864.382324, 41.248001)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 307) then --Utgarde Pinnacle
    player:Teleport(571, 1269.920654, -4854.597168, 215.763885)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 308) then --The Nexus
    player:Teleport(571, 3856.677490, 6983.687988, 86.094810)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 309) then --Azjol-Nerub
    player:Teleport(571, 3721.598633, 2169.613525, 37.027439)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 310) then --Ahn'kahet
    player:Teleport(571, 3653.818115, 2068.238525, 4.150550)
    pUnit:GossipComplete(player)
    end
    
    if(intid == 311) then --Halls of Lightning
    player:Teleport(571, 9082.833984, -1312.702759, 1058.398315)
    pUnit:GossipComplete(player)
    end
    end
    
    RegisterUnitGossipEvent(100255, 1, "On_Gossip")
    RegisterUnitGossipEvent(100255, 2, "Gossip_Submenus")

  3. #3
    Evilbuffy's Avatar Member
    Reputation
    38
    Join Date
    Mar 2009
    Posts
    185
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It worked, and I've given you +Rep for helping out!

    Ps; Sorry for the +Rep coming so late, I've been away for a couple of days. =)

Similar Threads

  1. [LUA] Teleport Stone Issue
    By marco1234 in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 03-29-2009, 07:05 AM
  2. Help with lua teleporter
    By Arugos in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 09-17-2008, 09:09 AM
  3. Lua scripting Issue
    By jbryan9184 in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 07-05-2008, 04:16 PM
  4. Lua Portal [Issue]
    By God-Of-War in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 07-05-2008, 07:48 AM
  5. [LUA] Teleport on spell use
    By Eponyx in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 05-24-2008, 10:10 AM
All times are GMT -5. The time now is 08:21 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