This may be noobish of me, but here is the deal.
Code:
function On_Gossip(punit, event, player)
punit:GossipCreateMenu(100, player)
punit:GossipMenuAddItem(player,0, "test1", 1, 0)
punit:GossipMenuAddItem(player,0, "test2", 2, 0)
punit:GossipSendMenu(player)
end
function Gossip_Submenus(punit, event, player, id, intid, code)
if(intid == 1) then
punit:SendChatMessage(12, 0, "hello1")
player:GossipComplete()
end
if(intid == 2) then
punit:SendChatMessage(12, 0, "hello2")
player:GossipComplete()
end
end
RegisterGossipEvent(45106, 7, "On_Gossip")(45106, 7,"Gossip_Submenus")
Have also tried:
Code:
RegisterUnitEvent(45106, 7, "On_Gossip")(45106, 7,"Gossip_Submenus")
The problem is I continually get a attempt to call global 'RegisterGossipEvent' (a nil value) with register gossip and something similar with registerunit.
Any ideas?