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

How do I make a player change a team with a script?

Asked by 7 years ago

I'm trying to make a script that when a player dies he changes from the "Survivors" team to the "Lobby" team. I have been trying for a while now but I can't seem to get it right. I know how to implement a script that checks if the humanoid (from the player) is dead, but I could use some help to make the player also change team.

1 answer

Log in to vote
0
Answered by
TrippyV 314 Donator Moderation Voter
7 years ago
Edited 7 years ago

First thing first, make sure to post the code that you're having problems with.

Besides that, to change teams of a player, you have to change their TeamColor property located in the Player.


This should do the trick:

game.Players["PlayerNameHere"].TeamColor = BrickColor.new("TeamColor")

If you have any problems, be sure to comment and we'll work it out together!

0
Thanks! It works now :) blacksmiley0 19 — 7y
Ad

Answer this question