randomMap = game.Workspace:WaitForChild("mapStorage"):GetChildren()
local replicatedstorage = game:GetService('ReplicatedStorage')
local status = replicatedstorage:WaitForChild('infovalue')
while wait() do
if game.Players.NumPlayers > 1 then
for i = 50, 0, -1 do
status.Value = "Intermission time: "..i
wait(1)
end
status.Value = "Intermission over, Get ready!"
wait(2)
status.Value = "Picking an Arena"
ranmap = math.random(1, #randomMap)
mapChos = randomMap[ranmap]
wait(2)
status.Value = "Arena Chosen: "..mapChos.Name
wait(3)
mapChosen = mapChos:Clone()
mapChosen.Parent = game.Workspace
spawns = mapChosen.Spawns:GetChildren()
for i,v in pairs(game.Players:GetPlayers()) do
Humanoid = v.Character.Humanoid
if Humanoid then
v.Character:MoveTo(spawns[i].Position)
Sword = game.ReplicatedStorage.ClassicSword:Clone()
Sword.Parent = v.Backpack
end
end
status.Value = "Sword Match in Progress"
wait(40)
status.Value = "Great Job!"
wait(2)
mapChosen:Destroy()
for i,v in pairs(game.Players:GetPlayers()) do
HumanoidL = v.Character.Humanoid
if HumanoidL then
v.Character:breakJoints()
end
end
mapChosen:Destroy()
else
status.Value = "There needs to be 1 or more players to play"
end
end
It works but what I want it to do is say that theres 3 players in a game in the map, wat if 2 die and theres one left? it still waits the 40 seconds, but wat i want it to do is end the match. Can anyone help?