need help to fix this lua script menu

User Tag List

Results 1 to 4 of 4
  1. #1
    sadoh92's Avatar Member
    Reputation
    3
    Join Date
    Jul 2023
    Posts
    2
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need help to fix this lua script

    Hi, i write a lua script for a simple teleporter for eluna trinitycore 3.3.5, here the code
    Code:
    local UnitEntry = "123456"
    
    function OnGossipHello(unit, player, creature)
      player:GossipMenuAddItem(0, "Teleport to Dalaran", 1, 0)
      player:GossipSendMenu(1, creature)
    end
    
    function Menu_Teleport_To_Dalaran(event, player, creature, sender, intid, code)
      if intid == 1 then
        player:Teleport(571, 6667.5, 6160.6, -11.78)
        player:GossipComplete()
      end
    end
    
    RegisterCreatureGossipEvent(UnitEntry, 1, OnGossipHello)
    RegisterPlayerEvent(2, Menu_Teleport_To_Dalaran)
    with this i can saw the gossip menu but when i click teleport to dalaran notting happen, anyone can tell me whats wrong with the script? i really cant understand
    THX

    need help to fix this lua script
  2. #2
    Strath's Avatar Elite User
    Reputation
    585
    Join Date
    Apr 2013
    Posts
    531
    Thanks G/R
    75/136
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by sadoh92 View Post
    Hi, i write a lua script for a simple teleporter for eluna trinitycore 3.3.5, here the code
    Code:
    local UnitEntry = "123456"
    
    function OnGossipHello(unit, player, creature)
      player:GossipMenuAddItem(0, "Teleport to Dalaran", 1, 0)
      player:GossipSendMenu(1, creature)
    end
    
    function Menu_Teleport_To_Dalaran(event, player, creature, sender, intid, code)
      if intid == 1 then
        player:Teleport(571, 6667.5, 6160.6, -11.78)
        player:GossipComplete()
      end
    end
    
    RegisterCreatureGossipEvent(UnitEntry, 1, OnGossipHello)
    RegisterPlayerEvent(2, Menu_Teleport_To_Dalaran)
    with this i can saw the gossip menu but when i click teleport to dalaran notting happen, anyone can tell me whats wrong with the script? i really cant understand
    THX
    idk sh1t about this but chat gpt has been useful for learning coding stuff like this. worth a shot.

  3. Thanks Eryx (1 members gave Thanks to Strath for this useful post)
  4. #3
    sadoh92's Avatar Member
    Reputation
    3
    Join Date
    Jul 2023
    Posts
    2
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    solved with this if anyone need
    Code:
     local UnitEntry = 1234562
    
    local function OnGossipHello(event, player, unit)
      -- Show teleport menu
      player:GossipMenuAddItem(0, "Teleport to Dalaran", UnitEntry, 1)
      player:GossipSendMenu(1, unit)
    end
    
    local function OnGossipSelect(event, player, unit, sender, intid, code)
      if (intid == 1) then
        player:Teleport(571, 5826, 470, 659, 1.4)
      end
      
      player:GossipComplete()
    end
    
    RegisterCreatureGossipEvent(UnitEntry, 1, OnGossipHello)
    RegisterCreatureGossipEvent(UnitEntry, 2, OnGossipSelect)

  5. Thanks Eryx, Strath (2 members gave Thanks to sadoh92 for this useful post)
  6. #4
    bertrand's Avatar Member
    Reputation
    1
    Join Date
    Jul 2024
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Chatgpt is really good at coding.

Similar Threads

  1. Need help to encode this..
    By Flashmoron in forum WoW Scams Help
    Replies: 0
    Last Post: 09-04-2008, 11:24 AM
  2. [Help] Need help to recognize this style!
    By R0w4n in forum Art & Graphic Design
    Replies: 5
    Last Post: 05-22-2008, 05:43 PM
  3. [WTH?] Funny bug about lua... yet i need help to fix it
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 02-26-2008, 09:42 AM
  4. How to fix this LUA Script???
    By marcosgue in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 02-08-2008, 07:51 AM
  5. Need help on fixing this chainquest thing! (+Rep if you tell it!)
    By Creepfold in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 12-25-2007, 05:57 PM
All times are GMT -5. The time now is 12:49 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search