Advertisement
Rochet2

Untitled

Mar 5th, 2015
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. local function OnGossipHello(pUnit, event, player)
  2.     pUnit:GossipCreateMenu(100, player,  0)
  3.     pUnit:GossipMenuAddItem(0, "return number 1", 1, 0)
  4.     pUnit:GossipMenuAddItem(0, "Return number 2", 2, 0)
  5.     pUnit:GossipSendMenu(player)
  6. end
  7.  
  8. local function OnGossipSelect(pUnit, event, player, id, intid, code)
  9.     if(intid == 1) then
  10.         print(1)
  11.     end
  12.     if(intid == 2) then
  13.         print(2)
  14.     end
  15.     -- basically could just do print(intid)
  16. end
  17.  
  18. ALTERNATIVE:
  19.  
  20. local function OnGossipHello(pUnit, event, player)
  21.     pUnit:GossipCreateMenu(100, player,  0)
  22.     pUnit:GossipMenuAddItem(0, "return number 1", 1, 0)
  23.     pUnit:GossipMenuAddItem(0, "Return number 2", 1, 0)
  24.     pUnit:GossipSendMenu(player)
  25. end
  26.  
  27. local function OnGossipSelect(pUnit, event, player, id, intid, code)
  28.     if(intid == 1) then
  29.         print(id)
  30.     end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement