Advertisement
Guest User

zero

a guest
Dec 6th, 2009
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.02 KB | None | 0 0
  1. --[ Made by Ground Zero - EVENT-GM Script]--
  2.  
  3. local Count = 0
  4. local Display = 11
  5.  
  6. function Racer_pre(unit, event, player)
  7.     if player:IsGm() == true then
  8.     unit:GossipCreateMenu(23829, player, 0)
  9.     unit:GossipMenuAddItem(0, "Line Up.", 216, 0)
  10.     unit:GossipMenuAddItem(0, "Countdown.", 217, 0)
  11.     unit:GossipMenuAddItem(0, "Finish Event", 218, 0)
  12.     unit:GossipMenuAddItem(0, "(Only GM's can see this Menu)", 219, 0)
  13.     unit:GossipMenuAddItem(0, "Nevermind", 219, 0)
  14.     unit:GossipSendMenu(player)
  15.     end
  16. end
  17.  
  18. function Racer_Start(pUnit, event, player, id, intid, code)
  19.     if(intid == 216) then
  20.     pUnit:SendChatMessage(42, 0, "Will all Contestants please proceed and line up on the Starting line! Do not Move Until The Countdown has Completed!")
  21.     pUnit:Emote(1, 5000)
  22.     player:GossipComplete()
  23.     end
  24.     if(intid == 217) then
  25.     Count = 1
  26.     pUnit:SetNPCFlags(2)
  27.     player:GossipComplete()
  28.     end
  29.     if (intid == 219) then
  30.     player:GossipComplete()
  31.     end
  32.     if (intid == 218) then
  33.     player:GossipComplete()
  34.         local name = player:GetName()
  35.         local PlayersAllAround = pUnit:GetInRangePlayers()
  36.         for a, plr in pairs(PlayersAllAround) do
  37.         plr:SetPlayerSpeed(7)
  38.         plr:DeMorph()
  39.         pUnit:SendChatMessage(42, 0, "<GM> "..name.." has ended the Event, Everyone has been demorphed and had their speed reset!")
  40.         end
  41.     end
  42. end
  43.  
  44. function Racer_OnSpawn(pUnit, Event)
  45.     pUnit:RegisterEvent("Lets_be_friends", 4000, 0)
  46. end
  47.  
  48. RegisterUnitGossipEvent(YOURENTRYID, 1, "Racer_pre")
  49. RegisterUnitGossipEvent(YOURENTRYID, 2, "Racer_Start")
  50. RegisterUnitEvent(YOURENTRYID, 18, "Racer_OnSpawn")
  51.  
  52. function Lets_be_friends(pUnit, Event)
  53.     if Count == 1 then
  54.     Count = 0
  55.     pUnit:RegisterEvent("LetsCount", 1000, 11)
  56.     pUnit:RegisterEvent("LetsCount_Reset", 12000, 1)
  57.     end
  58. end
  59.  
  60. function LetsCount(pUnit, Event)
  61.     Display = Display - 1
  62.     pUnit:SendChatMessage(42,0,""..Display.." seconds until the event starts!")
  63. end
  64.  
  65. function LetsCount_Reset(pUnit, Event)
  66.     Display = 0
  67.     pUnit:SetNPCFlags(1)
  68.     pUnit:SendChatMessage(42, 0, "Go Go!")
  69.     pUnit:SendChatMessage(42, 0, "Go Go!")
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement