Teleporter password menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Leppar's Avatar Member
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Teleporter password

    Hi my issue lies in a teleport npc. I have a working script and it has no problems for me but what i want to do is change it so when a player clicks to teleport he must enter a password.
    This is the teleporters lua
    Code:
    local intSay = 0
    
    function Teleporter1_OnGossip(Unit, Event, Player)
    if (intSay == 0) then
    Unit:SendChatMessage(12, 0, "Teleport away!")
    intSay = intSay + 1
    end
    Unit:GossipCreateMenu(100, Player, 0)
    Unit:GossipMenuAddItem(0, "Click here to teleport away from here.", 1, 0)
    Unit:GossipSendMenu(Player)
    end
    
    function Teleporter1_OnSubMenu(Unit, Event, Player, id, intid, code)
    
    if (intid == "1") then
    Player:Teleport(169,3434.65,3035.1,31.9966)
    end
    end
    
    RegisterUnitGossipEvent(310075, 1, "Teleporter1_OnGossip")
    RegisterUnitGossipEvent(310075, 2, "Teleporter1_OnSubMenu")
    Now i know that changing the 0 at the end of this line to 1 or 3 gives u an input box ingame... but how do i get the value which the player inputs to see if it matches the password i allow teleporting with.
    Code:
    Unit:GossipMenuAddItem(0, "Click here to teleport away from here.", 1, 0)

    Teleporter password
  2. #2
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your answer lies within:
    Code:
    function Teleporter1_OnSubMenu(Unit, Event, Player, id, intid, code)
    Usage:
    Code:
    if (intid == 1) then
         if code == "PASSWORD" then
               Player:Teleport(169,3434.65,3035.1,31.9966)
         end
    end

  3. #3
    Leppar's Avatar Member
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ohh i didnt realize i had to add another line for if btw... do i have to do that or is there a way to make 2 conditions with 1 line.

    thanks a lot btw

  4. #4
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Leppar View Post
    ohh i didnt realize i had to add another line for if btw... do i have to do that or is there a way to make 2 conditions with 1 line.

    thanks a lot btw
    It's possible to combine two conditions in one line, yes. You have the 'and' & 'or' statement for that. You can combine as many as you want on one line, if my memory serves me right.

    Usage:

    Code:
    if (intid == 1) and code == "PASSWORD" then
           Player:Teleport(169,3434.65,3035.1,31.9966)
    end

  5. #5
    Leppar's Avatar Member
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right... i ran into another problem with the same npc. I changed the
    Code:
    Unit:GossipCreateMenu(100, Player, 0)
    to a custom one i made in npc_text table. It worked nicely but after a while it stopped working. And now it only works with the 100, nothing else. I didn't change anything in the lua file and i had also restarted the server multiple times and it would still work with the custom text so i have no idea why it suddenly stopped working. So i put the 100 there and it worked just fine. Which puzzles me is that 100 doesnt even exist in npc_text so how can it be a gossip text. I also tried to make a 100 in npc_text but it stayed the same ingame.

  6. #6
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the text_id doesn't exist in the npc_text table it automatically uses a standard one.

    Try deleting your cache, by the way. Your cache saves a lot of things (including quest text, and texts like this), even if you have changed them.

  7. #7
    Leppar's Avatar Member
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nah... i sort of fixed it. It appears it doesnt work each time i spawn it... it works about 50% of the times it gets spawned and the working one works forever while the non-working one will never work. Thanks anyway.

Similar Threads

  1. Teleport through Goldshire Inn wall!
    By Örpheus in forum World of Warcraft Exploits
    Replies: 11
    Last Post: 07-27-2006, 06:08 AM
  2. Any working teleport hack?
    By iamtheovermind in forum World of Warcraft General
    Replies: 18
    Last Post: 07-12-2006, 12:17 PM
  3. Teleport to your home inn without heartstone
    By miigu in forum World of Warcraft Exploits
    Replies: 3
    Last Post: 06-19-2006, 12:44 AM
  4. Any working teleport hack?
    By iamtheovermind in forum World of Warcraft Bots and Programs
    Replies: 6
    Last Post: 05-05-2006, 04:38 PM
  5. [News] WoW Trojan Steals Passwords To Cash Out
    By Cypher in forum World of Warcraft General
    Replies: 9
    Last Post: 05-04-2006, 02:16 PM
All times are GMT -5. The time now is 07:31 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