How do I make this complicated round system?

Hello developers, I hope you are all well and if you are not, then you are…
So I want to make a system of rounds which I have already advanced, which I did with:

game.Players.PlayerAdded:Connect(Function(plr)
plr.characterAdded:Connect(function(char) 
-- Right here I put it to add a new instance (stringvalue)
char.Humanoid.Died:Connect(Function() 
--and in this part I made it delete the instance so that it would place it in spectator and wait until the round ends



end)

end)

end)

but the problem is that I don’t know how to know if the round is over
NOTE: the new instance is created as a child of the player’s team
If you have doubts, ask me without shame, ask, that’s why we were born to ask.
ASK… please and thank you by the way I don’t want them to give me a script it’s not mandatory I just want you to tell me how I do it

I don’t understand what you mean with the “new instance” you are referring to. Why not set the players team to Spectator or whatever team they are on?

Team:GetPlayers() | Roblox Creator Documentation can be used to determine which players, and therefore also how many players are in the team. If the team has no players left, that means everyone on the team has died, and the round should be over.

Apparently you did not understand sorry:
If you realize in that documentation it appears if the player CHANGES TEAM
but in my game NOBODY WILL CHANGE TEAMS they will only die and when the whole team dies it will restart
Who on his holy day said that when a player dies, his team folder is deleted?
And by the way, the value that you did not understand is created when the player enters the team folder (it is to know if the player is still alive)

and the documentation works but it is not what I am looking for

First of all make a value outside the player added, when the round start you get #game.Players:GetPlayers() and set it on that value

then if a player dies you do like value -= 1
Once it is 1 or 0 the round is over and you check everytime a player die what the status of the value is

1 Like

thanks for the help but what I want is that when all the players of a team die then the round ends I want to know ideas of how I do it as you told me right now in the previous answer thanks
By the way, I know that you explained it well there, but what I want is the way I explained, because if I do it your way then it wouldn’t work well since I have more modules that would be connected to that one.

2 values for the teams, attach players to a team of if you don’t use teams use collectionservice, add the tag of the team to the player like Red when the player dies you chekc what team he is on and reduce the value

1 Like

I already understood you, it is that I am very difficult to understand things, excuse me, I already understood, thank you, I will try if I have doubts, I will ask you, thank you

Hello, one question I know you already helped me but I need to know how I do so that the player character does not reappear until the game is over? What I did is working fine for me but what happens is that I need the player not to reappear how do I do it?

Disable in player or something LoadCharacter and if the player joins you just do player:LoadCharacter or do first a few checks

1 Like

Don’t forget to remove one if a player leaves

hey thanks for the help but i have a problem:

local players = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(plr)
	plr:LoadCharacter()
	print("aparecio")
	plr.CharacterAdded:Connect(function(char)
		char.Humanoid.Died:Connect(function(died)
			if not game.Workspace:FindFirstChild("empieza") then
				wait(1)
				plr:LoadCharacter()
				print("cargado")
			end
		end)
	end)	
	
	
end)

apparently it doesn’t work I checked if the instance starts it was destroyed but if it is destroyed but the script is the one with the error

i don’t really get what is wrong, or what your problem is.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.