Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can you get your game to know when there's no more players on a team left?

For example, if a person was on the blue team and they died, which changed them to the red team, what script would allow the game to recognize that there are no more players on the blue team and then execute commands.

Here's what I've tried

player.Character.Humanoid.Died:connect(function()
	player.TeamColor = BrickColor.new("Earth green")
	if #game.Teams.TeamA:GetPlayers() < 1 then
		-- run code for what happens when it reaches 0
	end 
end)

1 comment

0

you could use #game.Teams.TeamA:GetPlayers() == 0; to test, you may put some sort of debug function such as 'print(args)'

1 answer

You can let it know by just creating an Death Script and an LeaveSCriot . Watch Alvinblox on YouTube , he made a complete sword fight with everything. I think on episode 4 or 5 or 6 he made both scripts. Very small but useful! :) glad to help. And I can't write it for you cuz I'm not on Pc right now ^^

This discussion is preserved as it was. New answers, comments, and votes are closed.