ok so ive been working on a teleport and now that im done its not working please check this image out
below is my coding
Code:
Local UnitEntry = 63022
Local t = {
[1] = { "Transmog", 0,
{"Mall",530,-3594.909668,-132.460449,238.504929, 0.062176)
[2] = { "Twink Mall", 0,
{"Mall",1,-1650.029419,-4372.638672,10.235728, 1.60890)
},
[3] = { "Horde Cities", 1,
{"Orgrimmar", 1, 1503, -4415.5, 22, 0},
{"Undercity", 0, 1831, 238.5, 61.6, 0},
{"Thunderbluff", 1, -1278, 122, 132, 0},
{"Silvermoon", 530, 9484, -7294, 15, 0},
},
[4] = { "Alliance Cities", 0,
{"Stormwind", 0, -8905, 560, 94, 0.62},
{"Ironforge", 0, -4795, -1117, 499, 0},
{"Darnassus", 1, 9952, 2280.5, 1342, 1.6},
{"The Exodar", 530, -3863, -11736, -106, 2},
},
local function OnGossipHello(event, player, unit)
-- Show main menu
for i, v in ipairs(T) do
if (v[2] == 2 or v[2] == player:GetTeam()) then
player:GossipMenuAddItem(0, v[1], i, 0)
end
end
player:GossipSendMenu(1, unit)
end
local function OnGossipSelect(event, player, unit, sender, intid, code)
if (sender == 0) then
-- return to main menu
OnGossipHello(event, player, unit)
return
end
if (intid == 0) then
-- Show teleport menu
for i, v in ipairs(T[sender]) do
if (i > 2) then
player:GossipMenuAddItem(0, v[1], sender, i)
end
end
player:GossipMenuAddItem(0, "Back", 0, 0)
player:GossipSendMenu(1, unit)
return
else
-- teleport
local name, map, x, y, z, o = table.unpack(T[sender][intid])
player:Teleport(map, x, y, z, o)
end
player:GossipComplete()
end
RegisterItemGossipEvent(UnitEntry, 1, OnGossipHello)
RegisterItemGossipEvent(UnitEntry, 2, OnGossipSelect)