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

How do I make a team have a limited number of players?

Asked by 4 years ago

In this script, I still want players to randomly join either teams, but how do I also have a team with limited players?

This is my script inside Workspace.

teams = {"Crimson", "Black"}
teamLobby = {"White"}
teamPlrs = game.Players:GetChildren()

for i,v in pairs(teamPlrs) do
    wait(2)
    v.TeamColor = BrickColor.new(teams[math.random(1,#teams)])
end

In this code block, I tried adding limits to each team, but I get an error on line 7.

teams = {["Crimson"] = 1, ["Black"] = 10}

If there's any help, ideally a script, I would be appreciated.

0
So if u put everyone in a table and check its size it would help :I Robloxian_Hero1234 14 — 4y
0
? User#27966 0 — 4y

Answer this question