#Round needs to end when everyone is dead.
28 messages · Page 1 of 1 (latest)
players = {player1, player2}
player.Died:Connect(function()
table.remove(players, player)
if #players == 0 then
-- everyone died
end
end)
this is the basic idea
on game start add every player into the table
Well i tried something with that, but the thing is poeple join midround
and there already is a table indicating if they are alive or dead
or have escaped/won
people can join midround?
yea
then just add them into the table
you shouldve had put that into the forum name
i have a table
you could add a flag
and i quote "second script had around 13 versions but this one stays the best, but i need the clock to go to 5 when everyone is dead. and then play the cutscene... can yall help a brother out?"
local everyoneDead = false
-- in your clock loop
for i = Clock, 1, -1 do
wait(1)
if everyoneDead then
roundInfo.Timer.Value = 5
continue
end
roundInfo.Timer.Value = roundInfo.Timer.Value - 1
end
wait(1)
Second script is
function roundModule.Countdown(Status, Clock)
local roundInfo = game.ReplicatedStorage:WaitForChild("RoundInfo")
roundInfo.Status.Value = Status
roundInfo.Timer.Value = Clock
for i = Clock, 1, -1 do
wait(1)
roundInfo.Timer.Value = roundInfo.Timer.Value - 1
end
wait(1)
end
if you really want to go for a table there is a table in
Roundinfo.players
** You are now Level 2! **
if that is what u prefer fine
You already said it yourself you aint reading all of that, so it would indeed be hard for you to get the problem. thank you for your help.