-
Member
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
-
Elite User
Originally Posted by
sadoh92
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.
-
Post Thanks / Like - 1 Thanks
N/A (1 members gave Thanks to Strath for this useful post)
-
Member
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)
-
Post Thanks / Like - 2 Thanks
N/A,
Strath (2 members gave Thanks to sadoh92 for this useful post)
-
Member
Chatgpt is really good at coding.