I think this is what you're looking for let me know I'll try to help.
local team1playercount = game.ReplicatedStorage.numbervalue
local team2playercount = game.ReplicatedStorage.numbervalue
local teamlimit1 = 1
local teamlimit2 = 1
game.Players.PlayerAdded:Connect(function(player)
local team = math.random(1,2)
if team == 1 then
if team1playercount.Value ~= teamlimit1 then
team1playercount.Value = team1playercount.Value + 1
player.TeamColor = BrickColor.new("Really red")
else
if team2playercount.Value ~= teamlimit2 then
team1playercount.Value = team1playercount.Value + 1
player.TeamColor = BrickColor.new("Really red")
else
print("Both teams are full!")
end
end
elseif team == 2 then
if team2playercount.Value ~= teamlimit2 then
team1playercount.Value = team1playercount.Value + 1
player.TeamColor = BrickColor.new("Really red")
else
if team1playercount.Value ~= teamlimit1 then
team1playercount.Value = team1playercount.Value + 1
player.TeamColor = BrickColor.new("Really red")
else
print("Both teams are full!")
end
end
end
end)
1 comment
If there are teams in ur game, I'll be interested in playing ur game ^^