I've been trying to make a script that can detect how many people are on a team and if there is less than or equal to one person on a team.
This is what I've gotten so far but have no idea what to do and i'm stuck. Here is the script.
teams = game.GetService("Teams") team1 = teams.Playing local team1players
function onGameEnd()
team1players = team1:GetChildren()
if #team1players < 2 then
print("players less than 2")
end end
Pretty simple just change < to <=.
teams = game.GetService(“Teams”) team1 = teams.Playing local team1players function onGameEnd() team1players = team1:GetChildren() if #team1players < 2 then print(“players less than 2”) end if #team1players <= 1 then print(“players equal to or less then 1”) end end
You can also find more information here.