local status = game.ReplicatedStorage.Status
local maps = game.ReplicatedStorage.Maps:GetChildren()
while true do
for i = 1,20 do
status.Value = "Intermission "..20-i
wait(1)
end
local rand = math.random(1, #maps)
local map = maps[rand]:Clone()
map.Parent = workspace
status.Value = "The Next Challenge Will Be "..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 = 20
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 beaten The Challenge They Will be awarded"
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 Remaining: "..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() == 0 or #workspace.Ingame:GetChildren() == 1 and roundType == "Sword"
status.Value = workspace.Ingame:FindFirstAncestorWhichIsA("Model").Name.."Is The Last Person Standing and won Deadly Challenges"
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
Error 23:21:30.705 - ServerScriptService.Main:57: Expected 'then' when parsing if statement, got 'status'
