Hiya,
I've been playing around with a code for a simple teleporter npc that only has one location. I've checked the code over and over again, and I just can't see why it is giving an error. Here is the code:
-- Variables
local npcid = 50003
-- On Triggers
function OnTalk(Unit, Event, player)
Player:GossipMenuAddItem(2, "I am ready to go ashore.", npcid , 1)
Player:GossipMenuAddItem(2, "Never mind.", npcid , 2)
Player:GossipSendMenu(1, unit)
end
function OnSelect(Unit, Event, player, intid, code)
if (intid == 1) then
Player:Teleport(810, 13613.44842, 13608.508789, 12.098165, 1.535403)
Player:GossipComplete()
end
if (intid == 2) then
Player:GossipComplete()
end
end
-- RegisterUnitEvents
RegisterCreatureGossipEvent(npcid, 1, OnTalk)
RegisterCreatureGossipEvent(npcid, 2, OnSelect)
And whenever I click on the NPC I get an error in the server console saying
"lua:6: calling "GossipMenuAddItem" on bad self (bad argument : Player expected, got table)
Does anyone have any idea what might be going on here?