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

How do I change a player's team color on entry?

I threw together a simple script that was supposed to change a player's team color on entry. It didn't work. I traced the problem down to the player's team color simply not changing. If I replaced the line that changed the team color with any other arguments, it would run. How do I change a player's team color on entry?

The script:

game.Players.PlayerAdded:connect(function(newPlayer)
   if newPlayer:IsInGroup(311892) then                
      	newPlayer.TeamColor = BrickColor.new("Really black")
   end
end)

This isn't the exact script I used, but demonstrates what I did. There were no errors in the output.

1 answer

✓ Accepted answer
game.Players.PlayerAdded:connect(function(newPlayer)
   if newPlayer:IsInGroup(311892) then                
        newPlayer.TeamColor = game.Teams["Really Black"].TeamColor -- Make a team called Really Black then make it's team color really black.
if (newPlayer.TeamColor = = game.Teams["Really Black"].TeamColor)  and (newPlayer:IsInGroup(311892)) then
print("No error ")
else
print("Player not in group")
end
   end
end)

I don't know if it works but you can try :P. Please tell me if it works

6 comments

1

It doesn't matter with the team name "Really Black" You can change it up to whatever your group name is.

0

Information like that can be given simply by editing your answer. There's really no need to comment on your own answer.

0

I tried, but it did the same thing that my script did. The Join Script puts my player in the bottom team, and it never gets changed.

0

Apparently, nothing's working. It's a game issue. Even the automatic team-changing spawns don't work. The only way I can seem to change a player's team to Really Black is by doing it in Studio.

0

Never mind. Something was wrong with the team. I took it out and made a new team with the same settings, and it works just fine.

1

Lol just fixed syntax error.

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