Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 4th, 2011  |  syntax: Lua  |  size: 0.69 KB  |  views: 51  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function Lock_OnGossip(Unit, event, player)
  2.         Unit:GossipCreateMenu(100, player, 0)
  3.                 Unit:GossipMenuAddItem( 0, "Test SetPlayerLock(true)", 1, 0)
  4.                 Unit:GossipMenuAddItem( 0, "Test SetPlayerLock(false)", 2, 0)
  5.         Unit:GossipSendMenu(player)
  6. end
  7.  
  8. function Lock_OnSelect(Unit, event, player, id, intid, code, pMisc)
  9.         if (id == 0) then
  10.                 Unit:SendChatMessage(12, 0, "Locking", 0)
  11.                 player:SetPlayerLock(true)
  12.                 player:GossipComplete()
  13.     end
  14.         if (id == 1) then
  15.                 Unit:SendChatMessage(12, 0, "Unlocking", 0)
  16.                 player:SetPlayerLock(false)
  17.                 player:GossipComplete()
  18.     end
  19.  
  20. end
  21.        
  22. RegisterUnitGossipEvent(1000, 1, Lock_OnGossip)
  23. RegisterUnitGossipEvent(1000, 2, Lock_OnSelect)