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

I need help with a script?

Asked by
Prioxis 673 Moderation Voter
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Heres my script here

local numPlayers = 0

for i, v in next, game.Players:GetPlayers() do
if v:FindFirstChild("TeamColor") == BrickColor.new("Bright red") then
numPlayers = numPlayers + 1
elseif v:FindFirstChild("TeamColor") ~= BrickColor.new("Bright red") then
    numPlayers = numPlayers - 1
end
end

if numPlayers == 0 then

local player = game.Players:GetPlayers()

local pickedPl = math.random(1, #player)
pickedPl.TeamColor = BrickColor.new("Bright red")

end

but how do I make to where all the other players join a different team?

Answer this question