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

How to change a player's team if it dies while being on a specific team?(CLOSED)

In my game there are three teams - the Red team, the Blue team, and the Neutral team.

Red and Blue teams are not auto assignable, only Neutral team is.

I don't know how to make a script that: When a player dies while being on the Red or Blue team then it's team is changed into the Neutral team so it can spectate the players that are not dead yet.

Can you tell me how to make the script? Thanks!

2 comments

0

This is not a request site yada yada yada.

1 answer

✓ Accepted answer

game:GetService("Players").PlayerAdded for a new player added to the game.

Player.CharacterAdded for when their character spawns

Humanoid.Died for when their character dies

Chain these together, with a bit of team switching in Humanoid.Died.

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