Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local maps = game.ServerStorage:WaitForChild("Maps"):GetChildren()
- local lobby = game.Workspace:WaitForChild("Lobby")
- local message = game.Workspace:WaitForChild("Message")
- local numplayers = game.Workspace:WaitForChild("NumPlayers")
- local chosenmap= game.Workspace:WaitForChild("ChosenMap")
- local selected = game.Workspace:WaitForChild("SelectedMap")
- local playerNeeded = 1 -- for testing :P
- function deleteLastMap()
- selected:ClearAllChildren()
- end
- function checkPlayers()
- if numplayers.Value >= playerNeeded then
- return true
- else
- return false
- end
- end
- function getAlivePlayers()
- local n = 0
- local players = game.Players:GetPlayers()
- for i = 1,#players do
- if players[i].Settings.AFK.Value ~= false then
- if players[i].Character ~= nil then
- if players[i].Character.Humanoid.Health ~= 0 then
- if players[i].Settings.Playing.Value ~= false then
- n = n + 1
- end
- end
- end
- end
- end
- return n
- end
- function getWinners()
- local n = 0
- local players = game.Players:GetPlayers()
- for i = 1,#players do
- if players[i].Settings.AFK.Value ~= false then
- if players[i].Character ~= nil then
- if players[i].Character.Humanoid.Health ~= 0 then
- if players[i].Settings.Winners.Value ~= false then
- n = n + 1
- end
- end
- end
- end
- end
- return n
- end
- function intermission()
- for i = 5,1,-1 do -- 5 is the time
- wait(1)
- message.Value = "Intermission: "..i.." seconds!"
- end
- end
- function choosemap()
- message.Value = "Choosing minigame..."
- chosenmap.Value = math.random(1,#maps).Name
- end
- function displayChosen()
- message.Value = "Minigame Chosen: "..chosenmap.Value.."!"
- end
- function loadMinigame()
- message.Value = "Loading map..."
- local clone = game:GetService("ServerStorage").Maps:FindFirstChild(chosenmap.Value)
- clone:Clone().Parent = workspace
- end
- function startGame()
- end
- while true do
- wait()
- if checkPlayers() then
- intermission()
- wait(1)
- choosemap()
- wait(3)
- displayChosen()
- wait(2)
- loadMinigame()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement