Team Change Script

I am trying to achieve a correct way to make a team change script. However, and error occurs saying this:


I’ve tried switching the brickcolor to a color3, but then it switches saying “BrickColor expected, got Color3”. Any Ideas on how to fix this? Perhaps it’s a mistake I made in the script?:

script.RemoteEvent.OnServerEvent:Connect(function(player, team)

player.TeamColor = BrickColor.new(team.TeamColor)



end)

Why don’t you set the Team property instead?

script.RemoteEvent.OnServerEvent:Connect(function(player, team)
    player.Team = team
end)

Also make sure to secure this remote properly, so exploiters cannot change their team at their will.

2 Likes