Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make this script end when the players on the battlefield are dead?

Asked by 5 years ago

I've tried putting a block in the script and put an item within the player, as they currently are in battle, but it just seems to make the script break.

 Messages = 
{"-Need 2 or more players to start-","-Changing map-","-Round Over-","-Closing Clash Begins-"}
CountDown = {"-Closing Clash Begins In 10-","-Closing Clash Begins In 9-","-Closing Clash Begins In 8-","-Closing Clash Begins In 7-","-Closing Clash Begins In 6-","-Closing Clash Begins In 5-","-Closing Clash Begins In 4-","-Closing Clash Begins In 3-","-Closing Clash Begins In 2-","-Closing Clash Begins In 1-",}
GameCountdown = {"-Game Starts In 5-","-Game Starts In 4-","-Game Starts In 3-","-Game Starts In 2-","-Game Starts In 1-","-Game Playing-"}
Games = {game.ServerStorage.Map1:clone(),game.ServerStorage.Map2:clone(),game.ServerStorage.Map3:clone(),game.ServerStorage.Map4:clone(),game.ServerStorage.Map5:clone(),game.ServerStorage.Map6:clone(),game.ServerStorage.Map7:clone(),game.ServerStorage.Map8:clone(),game.ServerStorage.Map9:clone(),game.ServerStorage.Map10:clone()}
lobby = game.ServerStorage.Lobby:clone()
H = Instance.new("Hint")
M = Instance.new("Message")
Map = lobby:Clone()
MapOOF = game.ServerStorage.SafeLobby:Clone()
finalestrike = {game.ServerStorage.Final1:clone(),game.ServerStorage.Final2:clone(),game.ServerStorage.Final3:clone(),game.ServerStorage.Final4:clone(),game.ServerStorage.Final5:clone()}
Map.Parent = game.Workspace
while true do
wait()
if game.Players.numPlayers < 1 then
H.Parent = workspace
H.Text = Messages[1]
else
H:Remove()
H:remove()
H.Text = Messages[2]
wait(3)
H:Remove()
wait(5)
H.Parent = workspace
H.Text = GameCountdown[1]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = GameCountdown[2]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = GameCountdown[3]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = GameCountdown[4]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = GameCountdown[5]
wait(1)
H:Remove()
H:Remove()
H:Remove()
H:Remove()for i=1,#Games do
H.Parent = workspace
wait(3)
Map:Remove()
wait(2)
Map = Games[math.random(1,10)]:Clone()
Map.Parent = workspace
MapOOD = MapOOF:Clone()
MapOOD.Parent = workspace
wait(8)
H.Parent = workspace
H.Text = CountDown[1]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = CountDown[2]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = CountDown[3]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = CountDown[4]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = CountDown[5]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = CountDown[6]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = CountDown[7]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = CountDown[8]
wait(1)
H:Remove()
H.Parent = workspace
H.Text = CountDown[9]    
wait(1)
H:Remove()
H.Parent = workspace
H.Text = CountDown[10]
H:Remove()
H:Remove()
H:Remove()
wait(1)
H:Remove()
H:Remove()
H:Remove()
H.Parent = workspace
H.Text = Messages[4]
Map:Remove()
finalestrike = game.ServerStorage.Final1:clone()
finalestrike.Parent = workspace
wait(2)
H:Remove()
wait(30)
finalestrike:Remove()
MapOOD:Remove()
Map:Remove()
Map = lobby:Clone()
Map.Parent = workspace
H.Parent = workspace
H.Text = Messages[3]
wait(5)
H:Remove()
H:Remove()
wait(10)
end
end
end
0
use a loop for the countdown hellmatic 1523 — 5y
0
Insert all players into a table before the game begins, then remove them from the table as they die. Continuously check through the table until everyone has been removed then break the loop. awfulszn 394 — 5y
0
But if I have a lobby, and if ALL players are in the game, then the players in the lobby would still be there, making the game not continue. Kilobriderozero 0 — 5y

Answer this question