Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. --//Variables
  2. local Status = game.ReplicatedStorage["Game Listener"]:WaitForChild('Status')
  3. local Visible = game.ReplicatedStorage["Game Listener"]:WaitForChild('Visible')
  4. local plrs = game.Players
  5.  
  6. local Event = game.ReplicatedStorage["Game Listener"].Wins
  7. local Activated = false
  8. local Touched = false
  9. local Fired = false
  10.  
  11. --// Intermission Folder Variables
  12. local IntermissionFolder = game.ReplicatedStorage:WaitForChild("Intermission")
  13. local RemoteEvents = IntermissionFolder:WaitForChild("RemoteEvents")
  14. local TeleportRe = RemoteEvents:WaitForChild("Teleport")
  15.  
  16. --// Script Variables
  17. local Cooldown = false
  18.  
  19. local Time = game.ReplicatedStorage["Game Listener"].Time
  20. local allplrs = game.Players
  21. local Activated3 = true
  22.  
  23.  
  24.  
  25. --// Tables
  26. local Maps = {
  27. "Map1",
  28. "Map2",
  29. "Map3"
  30. };
  31.  
  32. --// Map Selection
  33. local MapChosen = Maps[math.random(1, #Maps)]
  34. --//Game
  35.  
  36. while Activated3 == true do
  37. Activated3 = false
  38. Visible.Value = true
  39. for i = 20, 0, -1 do
  40. Status.Value = "Intermission ("..i..")"
  41. wait(1)
  42. end
  43.  
  44. Status.Value = "Choosing map."
  45. wait(0.5)
  46. Status.Value = "Choosing map.."
  47. wait(0.5)
  48. Status.Value = "Choosing map..."
  49. wait(0.2)
  50. Status.Value = 'Beginning..'
  51. wait(2)
  52.  
  53. --//Random Map
  54. for i,v in pairs(Maps) do
  55. if v:lower() == MapChosen:lower() then
  56. local Map = game:GetService("ServerStorage"):FindFirstChild(v)
  57. if Map then
  58. Map.Parent = game.Workspace
  59. end
  60. end
  61. end
  62.  
  63. --// Intermission Function
  64. local function IntermissionText()
  65.  
  66. Status.Value = "Starting in 3"
  67. wait(1)
  68. Status.Value = "Starting in 2"
  69. wait(1)
  70. Status.Value = "Starting in 1"
  71. wait(1)
  72. Status.Value = "Begin!"
  73. wait(2)
  74. end
  75.  
  76. --// Teleport
  77. for i,v in pairs(game.Players:GetPlayers()) do
  78. local Humanoid = v.Character:WaitForChild("Humanoid")
  79. if Humanoid then
  80. Humanoid.WalkSpeed = 0
  81. TeleportRe:FireAllClients("testing")
  82. end
  83. end
  84.  
  85. TeleportRe.OnServerEvent:Connect(function(plr)
  86. if Cooldown == false then
  87. Cooldown = true
  88. for i,v in pairs(game.Players:GetPlayers()) do
  89. local HumanoidRootPart = v.Character:WaitForChild("HumanoidRootPart")
  90. if HumanoidRootPart then
  91. HumanoidRootPart.CFrame = CFrame.new(game.Workspace:WaitForChild(MapChosen):WaitForChild("Teleport").Position) * CFrame.new(0,3,0)
  92. end
  93. end
  94. for i,v in pairs(game.Players:GetPlayers()) do
  95. local Humanoid = v.Character:WaitForChild("Humanoid")
  96. if Humanoid then
  97. Humanoid.WalkSpeed = 0
  98. end
  99. end
  100. Status.Value = "Starting in 3"
  101. wait(1)
  102. Status.Value = "Starting in 2"
  103. wait(1)
  104. Status.Value = "Starting in 1"
  105. wait(1)
  106. Status.Value = "Begin!"
  107. wait(0.3)
  108. for i,v in pairs(game.Players:GetPlayers()) do
  109. local Humanoid = v.Character:WaitForChild("Humanoid")
  110. if Humanoid then
  111. Humanoid.WalkSpeed = 16
  112. end
  113. end
  114. end
  115. end)
  116.  
  117. Event.Event:Connect(function(name)
  118. if Activated == false then
  119. Activated = true
  120. Status.Value = name..' has won the game!'
  121. wait(1)
  122. for i,v in pairs(workspace:GetChildren())do
  123. if v:FindFirstChild('Humanoid') then
  124. local plr = v
  125. plr.Humanoid.Health = 0
  126. wait(1)
  127. Status.Value = 'Game has ended!'
  128. end
  129. wait()
  130. end
  131. wait(1)
  132. for i,v in pairs(Maps) do
  133. if v:lower() == MapChosen:lower() then
  134. local Map = game:GetService("ServerStorage"):FindFirstChild(v)
  135. if Map then
  136. Map.Parent = game.ServerStorage
  137.  
  138. end
  139. end
  140. end
  141. wait(1)
  142.  
  143.  
  144. end
  145. end)
  146. wait()
  147. game.ReplicatedStorage["Game Listener"].LoopStopper.Event:Connect(function()
  148. Activated3 = true
  149. print(Activated3)
  150. end)
  151.  
  152. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement