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

How do I do make a team change on death?

Asked by 5 years ago

i need to know how make it so when you join a server your team is "spectator" and when only one person on team "alive" is left, it kills everyone in the server and switches their team to "alive" and when you die your team changes to "spectator"

1 answer

Log in to vote
0
Answered by 5 years ago

You can connect a function to the PlayerAdded event of the Players Service, which will fire when a player joins the server. In that function, there you set the Team property of the player to the Spectator team object.

You can check if a player died by using the Died event of the player's humanoid, which will fire when the humanoid has been killed. In the event, you'll compare if the number of the alive players is less than or equal to 1.

0
This is very confusing to me, how exactly do i do this? APersonThatsBored 0 — 5y
0
I can't spoon-feed you a script, as SH isn't a request site cringe_worthey 97 — 5y
0
But, you can read up on the PlayerAdded event and the Died event, and learn to script, if you don't know how to cringe_worthey 97 — 5y
Ad

Answer this question