Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local randlocations = {
- {530, -1849.4200, 5401.4599, -12.4279},
- {0, -13243.240234, 197.949799, 32.112690},
- {530, 12956.072266, -6943.814453, 9.968110},
- {1, 9874.646484, 595.742432, 1303.874023}
- }
- local NPCID = 123123
- local ITEMID = 1482
- function Tele_OnTalk(Unit, Event, player)
- if (player:IsInCombat() == true) then
- player:SendAreaTriggerMessage("You are in combat!")
- player:GossipComplete()
- else
- Unit:GossipCreateMenu(100, player, 0)
- Unit:GossipMenuAddItem(0, "Gm Room", 1, 1)
- Unit:GossipMenuAddItem(0, "Player Room", 2, 0)
- Unit:GossipMenuAddItem(0, "Unlockable player room", 3, 0)
- Unit:GossipMenuAddItem(0, "Random teleport!", 4, 0)
- Unit:GossipSendMenu(player)
- end
- end
- function Tele_OnSelect(Unit, Event, player, id, intid, Code, pMisc)
- if (intid == 1) and
- (Code == "cake") then -- Put your code for your gm room here.
- player:Teleport(1, 16227.584961, 16401.560547, -63, 4.697150)
- player:GossipComplete()
- else
- player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r "..Code.." Is not the correct password.")
- --player:KickPlayer(0)
- player:GossipComplete()
- end
- if (intid == 2) then
- player:Teleport(1, 16241.043945, 16298.4688, 21, 1.484407)
- player:GossipComplete()
- end
- if (intid == 3) and
- player:GetItemCount(ITEMID) > 0 then
- player:Teleport(1, 16241.043945, 15298, 30, 1.5)
- --player:RemoveItem(ITEMID, 1)
- player:GossipComplete()
- elseif
- player:GetItemCount(ITEMID) == 0 then
- player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You have not unlocked this teleport yet!").
- player:GossipComplete()
- end
- if (intid == 4) then
- local choice = math.random(#randlocations)
- local coords = randlocations[choice]
- player:Teleport(coords[1],coords[2],coords[3],coords[4])
- end
- end
- RegisterUnitGossipEvent(NPCID, 1, "Tele_OnTalk")
- RegisterUnitGossipEvent(NPCID, 2, "Tele_OnSelect")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement