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

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

Asked by
Minifig77 190
10 years ago

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

Log in to vote
2
Answered by
HexC3D 830 Moderation Voter
10 years ago
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

1
It doesn't matter with the team name "Really Black" You can change it up to whatever your group name is. HexC3D 830 — 10y
0
Information like that can be given simply by editing your answer. There's really no need to comment on your own answer. TheGuyWithAShortName 673 — 10y
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. Minifig77 190 — 10y
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. Minifig77 190 — 10y
View all comments (2 more)
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. Minifig77 190 — 10y
1
Lol just fixed syntax error. HexC3D 830 — 10y
Ad

Answer this question