Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rps = game:GetService("ReplicatedStorage")
- local status = rps:WaitForChild("infovalue")
- local mapstorage = game.Workspace:WaitForChild("mapstorage")
- local gamemode = nil
- intermission = "rbxassetid://317061358"
- playing = {}
- victorysongs = {
- "rbxassetid://191907895",
- "rbxassetid://236626093",
- "rbxassetid://239902092",
- "rbxassetid://155722789",
- "rbxassetid://144208923",
- "rbxassetid://622483436"
- }
- gamemodes = {
- "team destruction",
- }
- while true do --main game loop
- --[[while game.Players.NumPlayers < 2 do
- status.Value = "There needs to be " .. 2 - game.Players.NumPlayers .. " more players to begin"
- repeat wait(1) until game.Players.NumPlayers > 2
- end--]]--
- for i = 45,0,-1 do
- status.Value = "Intermission ".. i
- wait(1)
- end
- --choosing random maps
- local miss = game:GetService("ServerStorage").maps:GetChildren()
- local choosemapa = math.random(1,#miss)
- local chosenmapa = miss[choosemapa]
- table.remove(miss,choosemapa)
- rps.mapchoose.mapa.mapname.Value = chosenmapa.Name
- local choosemapb = math.random(1,#miss)
- local chosenmapb = miss[choosemapb]
- table.remove(miss,choosemapb)
- rps.mapchoose.mapb.mapname.Value = chosenmapb.Name
- --puting up voting gui
- status.Value = "Voting for map..."
- for _,player in pairs (game.Players:GetPlayers()) do
- if player.playing.Value then
- player.PlayerGui.maps.mainframe.Visible = true
- end
- end
- wait(10)
- --finding out the highest voted map
- local maps = rps.mapchoose:GetChildren()
- table.sort(maps,function(a,b)
- return a.Value > b.Value
- end)
- local highestValue = maps[1]
- local chosenmap = game:GetService("ServerStorage").maps:FindFirstChild(highestValue.mapname.Value)
- rps.mapchoose.mapa.Value = 0
- rps.mapchoose.mapb.Value = 0
- --[[if chosenmap == "destructionrun" then
- workspace.gamemode.Value = "Destruction run"
- else
- local rndmode = math.random(1,#gamemodes)
- rndmode = gamemodes[rndmode]
- workspace.gamemode.Value = rndmode
- end]]--
- chosenmap:Clone().Parent = mapstorage
- wait(2)
- status.Value = "loading game"
- local spawns = chosenmap:WaitForChild("spawns"):GetChildren()
- for _,player in pairs(game.Players:GetPlayers()) do
- if player and #spawns >0 then
- if player.playing.Value then
- local allspawns = math.random(1,#spawns)
- local rndspawn = spawns[allspawns]
- if rndspawn and player then
- table.remove(spawns,allspawns)
- player.Character:MoveTo(rndspawn.Position)
- player.PlayerGui.maps.mainframe.Visible = false
- table.insert(playing,player)
- end
- player.Character.Humanoid.WalkSpeed = 0
- player.Character.Humanoid.JumpPower = 0
- player.PlayerGui.gameplaygui.main.gameplayfunctions.Disabled = false
- player.PlayerGui.menu.mainframe.Visible = false
- if player.PlayerGui:FindFirstChild("intermissionmusic") then
- player.PlayerGui.intermissionmusic:Destroy()
- end
- end
- end
- end
- wait(5)
- local lobbyspawns = workspace.lobby.lobbyspawns:GetChildren()
- for i = 60,0,-1 do
- status.Value = "game " .. i
- if i == 0 or game.ServerStorage.Winner.Value ~= "false" then
- status.Value = "Times up!"
- for _,player in pairs(game.Players:GetPlayers()) do
- local victorysong = math.random(1,#victorysongs)
- local song = victorysongs[victorysong]
- if player.PlayerGui:FindFirstChild("Song")then player.PlayerGui:FindFirstChild("Song"):Destroy() end
- local sound = Instance.new("Sound",player.PlayerGui)
- sound.SoundId = song
- sound.Name = "Song"
- sound:play()
- player.PlayerGui.awardgui.mainframe.main.awardhandling.Disabled = false
- player.Character.Humanoid.WalkSpeed = 16
- player.Character.Humanoid.JumpPower = 50
- if player.PlayerGui:FindFirstChild("intermissionmusic") then
- player.PlayerGui.intermissionmusic:Destroy()
- end
- local rndspawn = lobbyspawns[math.random(1,#lobbyspawns)]
- player.Character:MoveTo(rndspawn.Position)
- player.PlayerGui.menu.mainframe.Visible = true
- end
- break
- else
- end
- wait(1)
- end
- mapstorage:ClearAllChildren()
- wait(8)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement