local status = game.ReplicatedStorage.Status local maps = game.ReplicatedStorage.Maps:GetChildren()
while true do for i = 1,10 do status.Value = "Intermission "..10-i wait(1) end
local rand = math.random(1, #maps)
local map = maps[rand]:Clone()
map.Parent = workspace
status.Value = "We'll be playing "..map.Name
wait(4)
local players = game.Players:GetChildren()
for i = 1,#players do
if players[i].Character ~= nil then
local spawnLocation = math.random(1,#workspace.Teleports:GetChildren())
players[i].Character:MoveTo(workspace.Teleports:GetChildren()[spawnLocation].Position)
players[i].Character.Parent = workspace.Ingame
end
end
local roundLength = 60
local canWin = true
local roundType = ""
if map:FindFirstChild("Obby") then
roundType = "Obby"
map.EndPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
canWin = false
status.Value = hit.Parent.Name.." has won!"
end
end)
elseif map:FindFirstChild("Sword") then
roundType = "Sword"
local children = workspace.Ingame:GetChildren()
for i = 1,#children do
map:FindFirstChildWhichIsA("Tool"):Clone().Parent = children[i]
end
map:FindFirstChildWhichIsA("Tool"):Destroy()
end
repeat
roundLength = roundLength -1
status.Value = "Time Left: "..roundLength
wait(1)
until roundLength == 0 or canWin == false or #workspace.Ingame:GetChildren() == 0 or (#workspace.Ingame:GetChildren() == 1 and roundType == "Sword")
if #workspace.Ingame:GetChildren() == 1 and roundType == "Sword" then
status.Value = workspace.Ingame:FindFirstChildWhichIsA("Model").Name.. "has won!"
end
wait(3)
map:Destroy()
local players = game.Players:GetChildren()
for i = 1,#players do
if players[i].Character ~= nil then
players[i]:LoadCharacter()
end
end
end~~~~~~~~~~~~~~~~~

1 comment
i need a picture of what workspace looks like and try puttin all your code into the lua platform not just the middle