local KeyNPC = {}
local KeyNPC.ID = x
local KeyNPC.Code = "testcode"
function KeyNPC.OnGossipHello(event, player, unit)
player:GossipMenuAddItem(0, "Code Input Example", 0, 1, true, "Please insert your code below.")
player:GossipSendMenu(1, unit)
end
function KeyNPC.OnGossipSelect(event, player, object, sender, intid, code)
if(code == KeyNPC.Code) then
-- Do stuff here
end
end
RegisterCreatureGossipEvent(KeyNPC.ID, 1, KeyNPC.OnGossipHello)
RegisterCreatureGossipEvent(KeyNPC.ID, 2, KeyNPC.OnGossipSelect)