Code:
function On_Gossip(pUnit, Event, player)
pUnit:GossipCreateMenu(3544, player, 0)
pUnit:GossipMenuAddItem(2, "Teleport Me", 1, 0)
pUnit:GossipMenuAddItem(1, "I would like to Learn a spell", 2, 0)
pUnit:GossipSendMenu(player)
end
function Gossip_Submenus(pUnit, event, player, id, intid, code)
if(intid == 999) then
pUnit:GossipCreateMenu(3543, player, 0)
pUnit:GossipMenuAddItem(2, "|cFF00FF00--Teleport Me--", 1, 0)
pUnit:GossipMenuAddItem(3, "|cFF00FFFF-Learn me some PvP/Fun spells-", 2, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 1) then
pUnit:GossipCreateMenu(3543, player, 0)
pUnit:GossipMenuAddItem(1, "|cFF00FF00-- Shopping Mall --", 44, 0)
pUnit:GossipMenuAddItem(1, "|cFF00FF00-- Events --", 55, 0)
pUnit:GossipMenuAdditem(1, "|cFF00FF00-- Hyal Levelingroad --", 66, 0)
pUnit:GossipMenuAdditem(1, "|cFF00FF00-- PvP Areas --", 88, 0)
pUnit:GossipMenuAdditem(1, "|cFF00FF00-- Capital bar --", 99, 0)
pUnit:GossipMenuAddItem(0, "|cFF00FFFF-- [Back] --", 999, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 2) then
pUnit:GossipCreateMenu(3543, player, 0)
pUnit:GossipMenuAddItem(1, "|cFFFF0000- Impairing Poison -", 796, 0)
pUnit:GossipMenuAddItem(0, "|cFF00FFFF[Back]", 999, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 55) then
pUnit:GossipCreateMenu(3543, player, 0)
pUnit:GossipMenuAddItem(1, "|cFFFF0000- Karazhan event", 111, 0)
pUnit:GossipMenuAddItem(1, "|cFFFF0000- The DarkShore Road", 112, 0)
pUnit:GossipMenuAddItem(1, "|cFFFF0000- Coins of ZangarMarsh", 113, 0)
pUnit:GossipMenuAddItem(1, "|cFFFF0000- Event 4", 114, 0)
pUnit:GossipMenuAddItem(0, "|cFF00FFFF[Back]", 1, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 88) then
pUnit:GossipCreateMenu(3543, player, 0)
pUnit:GossipMenuAddItem(1, "|cFF00FFFF**Nagrand Arena**", 910, 0)
pUnit:GossipMenuAddItem(1, "|cFF00FFFF**Gurubashi Arena**", 911, 0)
pUnit:GossipMenuAddItem(0, "*[Back]*", 1, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 796) then
player:LearnSpell(36839)
pUnit:GossipComplete(player)
end
if(intid == 44) then
player:Teleport(1, 7345.910156, -1540.229980, 161.311996)
pUnit:GossipComplete(player)
end
if(intid == 66) then
player:Teleport(1, 4612.712891, -3861.186035, 944.176453)
pUnit:GossipComplete(player)
end
if(intid == 99) then
player:Teleport(1, -6802.372070, -2908.077162, 16.065159)
pUnit:GossipComplete(player)
end
if(intid == 111) then
player:Teleport(0, -11110.259766, -2037.760010, 47.967651
)
pUnit:GossipComplete(player)
end
if(intid == 112) then
player:Teleport(1, -7431.365234, -1575.177368, 178.341675)
pUnit:GossipComplete(player)
end
if(intid == 113) then
player:Teleport(1, -9491.288086, -1699.527710, 9.819820
)
pUnit:GossipComplete(player)
end
if(intid == 114) then
player:Teleport(1, 3380.894531, -3322.465088, 314.074799)
pUnit:GossipComplete(player)
end
if(intid == 910) then
player:Teleport(530, -2010.819092, 6672.520020, 18.241858)
pUnit:GossipComplete(player)
end
if(intid == 911) then
player:Teleport(0, -13263.840820, 158.996063, 36.095226)
pUnit:GossipComplete(player)
end
end
RegisterUnitGossipEvent(454545, 1, "On_Gossip")
RegisterUnitGossipEvent(454545, 2, "Gossip_Submenus")
I get this error :My Teleporter name.lua:21: attempt to call method `GossipMenuAdditem` <a nil value>