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

How do I team change when died? [UNANSWERED!]

When a player dies, how do I make them team change?

Like, if someone is in a lobby. When a player enters the arena, when they die how do I make them team change into the arena so they don't have to come back?

1 comment

0

It will work, though why is it "UNANSWERED!"

1 answer

game.Players.PlayerAdded:connect(function(plr)
plr.Nuetral = false
plr.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()

 if plr.TeamColor ==  BrickColor.new("Bright red") then
plr.TeamColor =  BrickColor.new("Bright Blue")
else
plr.TeamColor = BrickColor.new("Bright red")
end
end)


end)


end)

If This helped +1

12 comments

0

I get an error. It says : Workspace.Script:2: attempt to index field 'Character' (a nil value)

0

Try again

0

Still doesn't work. Error = Workspace.Script:7: bad argument #3 to 'TeamColor' (BrickColor expected, got string)

0

Whoops, let me fix

0

Fixed it.

0

It works, but it changes the players team to "Neutral".

0

Make 2 team Bright Red and Bright blue and then the lobby.

0

Changed it

0

You spell neutral wrong.

0

Do both teams have to be Auto assembled? Because if I don't, I can't use it.

0

They don't have too, but if there is a team with same teamcolor then it will change the players team to that team,

0

It still isn't working. It creates a new team called "Neutral".

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