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?
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?
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
I get an error. It says : Workspace.Script:2: attempt to index field 'Character' (a nil value)
Try again
Still doesn't work. Error = Workspace.Script:7: bad argument #3 to 'TeamColor' (BrickColor expected, got string)
Whoops, let me fix
Fixed it.
It works, but it changes the players team to "Neutral".
Make 2 team Bright Red and Bright blue and then the lobby.
Changed it
You spell neutral wrong.
Do both teams have to be Auto assembled? Because if I don't, I can't use it.
They don't have too, but if there is a team with same teamcolor then it will change the players team to that team,
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.
1 comment
It will work, though why is it "UNANSWERED!"