Advertisement
Guest User

Untitled

a guest
May 19th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.79 KB | None | 0 0
  1. local randlocations = {
  2. {530, -1849.4200, 5401.4599, -12.4279},
  3. {0, -13243.240234, 197.949799, 32.112690},
  4. {530, 12956.072266, -6943.814453, 9.968110},
  5. {1, 9874.646484, 595.742432, 1303.874023}
  6. }
  7.  
  8. local NPCID = 123123
  9. local ITEMID = 1482
  10.  
  11. function Tele_OnTalk(Unit, Event, player)
  12. if (player:IsInCombat() == true) then
  13. player:SendAreaTriggerMessage("You are in combat!")
  14. player:GossipComplete()
  15. else
  16. Unit:GossipCreateMenu(100, player, 0)
  17. Unit:GossipMenuAddItem(0, "Gm Room", 1, 1)
  18. Unit:GossipMenuAddItem(0, "Player Room", 2, 0)
  19. Unit:GossipMenuAddItem(0, "Unlockable player room", 3, 0)
  20. Unit:GossipMenuAddItem(0, "Random teleport!", 4, 0)
  21. Unit:GossipSendMenu(player)
  22. end
  23. end
  24.  
  25. function Tele_OnSelect(Unit, Event, player, id, intid, Code, pMisc)
  26. if (intid == 1) and
  27. (Code == "cake") then -- Put your code for your gm room here.
  28. player:Teleport(1, 16227.584961, 16401.560547, -63, 4.697150)
  29. player:GossipComplete()
  30. else
  31. player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r "..Code.." Is not the correct password.")
  32. --player:KickPlayer(0)
  33. player:GossipComplete()
  34. end
  35.  
  36. if (intid == 2) then
  37. player:Teleport(1, 16241.043945, 16298.4688, 21, 1.484407)
  38. player:GossipComplete()
  39. end
  40.  
  41. if (intid == 3) and
  42. player:GetItemCount(ITEMID) > 0 then
  43. player:Teleport(1, 16241.043945, 15298, 30, 1.5)
  44. --player:RemoveItem(ITEMID, 1)
  45. player:GossipComplete()
  46. elseif
  47. player:GetItemCount(ITEMID) == 0 then
  48. player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You have not unlocked this teleport yet!").
  49. player:GossipComplete()
  50. end
  51.  
  52. if (intid == 4) then
  53. local choice = math.random(#randlocations)
  54. local coords = randlocations[choice]
  55. player:Teleport(coords[1],coords[2],coords[3],coords[4])
  56. end
  57. end
  58.  
  59. RegisterUnitGossipEvent(NPCID, 1, "Tele_OnTalk")
  60. RegisterUnitGossipEvent(NPCID, 2, "Tele_OnSelect")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement