The script looks fine.
The issue here is a small bug with Lua: You can't have only one menu item.
If you change it to:
Code:
function testOn_Gossip(Unit, event, player)
Unit:GossipCreateMenu(1, player, 0)
Unit:GossipMenuAddItem(0, "Screw you Oxhorn.", 1, 0)
Unit:GossipMenuAddItem(0, "Nevermind.", 2, 0)
Unit:GossipSendMenu(player)
end
function testSubMenu_Gossip(Unit, event, player, id, intid, code)
if (intid == 1) then
Unit:SendChatMessage(12, 7, "**** off buddy, you don't want to fight with me.")
end
Unit:GossipComplete()
end
RegisterUnitGossipEvent(99999, 1, "testOn_Gossip")
RegisterUnitGossipEvent(99999, 2, "testSubMenu_Gossip")
It should work
Using:
Code:
function testOn_Gossip(Unit, event, player)
Unit:GossipCreateMenu(1, player, 0)
Unit:GossipMenuAddItem(0, "Screw you Oxhorn.", 1, 0)
if (not Unit) then
Unit:GossipMenuAddItem(0, "[DEBUG BUTTON - WILL NOT SHOW]", 2, 0)
end
Unit:GossipSendMenu(player)
end
Sometimes works at displaying only one button, since the other button condition is never met but the code is loaded.