Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --//Variables
- local Status = game.ReplicatedStorage["Game Listener"]:WaitForChild('Status')
- local Visible = game.ReplicatedStorage["Game Listener"]:WaitForChild('Visible')
- local plrs = game.Players
- local Event = game.ReplicatedStorage["Game Listener"].Wins
- local Activated = false
- local Touched = false
- local Fired = false
- --// Intermission Folder Variables
- local IntermissionFolder = game.ReplicatedStorage:WaitForChild("Intermission")
- local RemoteEvents = IntermissionFolder:WaitForChild("RemoteEvents")
- local TeleportRe = RemoteEvents:WaitForChild("Teleport")
- --// Script Variables
- local Cooldown = false
- local Time = game.ReplicatedStorage["Game Listener"].Time
- local allplrs = game.Players
- local Activated3 = true
- --// Tables
- local Maps = {
- "Map1",
- "Map2",
- "Map3"
- };
- --// Map Selection
- local MapChosen = Maps[math.random(1, #Maps)]
- --//Game
- while Activated3 == true do
- Activated3 = false
- Visible.Value = true
- for i = 20, 0, -1 do
- Status.Value = "Intermission ("..i..")"
- wait(1)
- end
- Status.Value = "Choosing map."
- wait(0.5)
- Status.Value = "Choosing map.."
- wait(0.5)
- Status.Value = "Choosing map..."
- wait(0.2)
- Status.Value = 'Beginning..'
- wait(2)
- --//Random Map
- for i,v in pairs(Maps) do
- if v:lower() == MapChosen:lower() then
- local Map = game:GetService("ServerStorage"):FindFirstChild(v)
- if Map then
- Map.Parent = game.Workspace
- end
- end
- end
- --// Intermission Function
- local function IntermissionText()
- Status.Value = "Starting in 3"
- wait(1)
- Status.Value = "Starting in 2"
- wait(1)
- Status.Value = "Starting in 1"
- wait(1)
- Status.Value = "Begin!"
- wait(2)
- end
- --// Teleport
- for i,v in pairs(game.Players:GetPlayers()) do
- local Humanoid = v.Character:WaitForChild("Humanoid")
- if Humanoid then
- Humanoid.WalkSpeed = 0
- TeleportRe:FireAllClients("testing")
- end
- end
- TeleportRe.OnServerEvent:Connect(function(plr)
- if Cooldown == false then
- Cooldown = true
- for i,v in pairs(game.Players:GetPlayers()) do
- local HumanoidRootPart = v.Character:WaitForChild("HumanoidRootPart")
- if HumanoidRootPart then
- HumanoidRootPart.CFrame = CFrame.new(game.Workspace:WaitForChild(MapChosen):WaitForChild("Teleport").Position) * CFrame.new(0,3,0)
- end
- end
- for i,v in pairs(game.Players:GetPlayers()) do
- local Humanoid = v.Character:WaitForChild("Humanoid")
- if Humanoid then
- Humanoid.WalkSpeed = 0
- end
- end
- Status.Value = "Starting in 3"
- wait(1)
- Status.Value = "Starting in 2"
- wait(1)
- Status.Value = "Starting in 1"
- wait(1)
- Status.Value = "Begin!"
- wait(0.3)
- for i,v in pairs(game.Players:GetPlayers()) do
- local Humanoid = v.Character:WaitForChild("Humanoid")
- if Humanoid then
- Humanoid.WalkSpeed = 16
- end
- end
- end
- end)
- Event.Event:Connect(function(name)
- if Activated == false then
- Activated = true
- Status.Value = name..' has won the game!'
- wait(1)
- for i,v in pairs(workspace:GetChildren())do
- if v:FindFirstChild('Humanoid') then
- local plr = v
- plr.Humanoid.Health = 0
- wait(1)
- Status.Value = 'Game has ended!'
- end
- wait()
- end
- wait(1)
- for i,v in pairs(Maps) do
- if v:lower() == MapChosen:lower() then
- local Map = game:GetService("ServerStorage"):FindFirstChild(v)
- if Map then
- Map.Parent = game.ServerStorage
- end
- end
- end
- wait(1)
- end
- end)
- wait()
- game.ReplicatedStorage["Game Listener"].LoopStopper.Event:Connect(function()
- Activated3 = true
- print(Activated3)
- end)
- wait()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement