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

How do I make a script that changes a person's team when they die?

Asked by 10 years ago

So I want to make it so that once someone on ANY team (There are 2 in the game, and 1 neutral, which is the lobby) dies, they will be changed to the Neutral team, so that they will spawn in the lobby. I think it would be something like: OnPlayerDeath.Team = Neutral. I know that obviously isn't the code, which Is why I'm asking e.e.

1 answer

Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
10 years ago
Plr=game.Players.LocalPlayer
P=Plr.Name
while true do
wait()
if game.Workspace:FindFirstChild(P)~=nil and game.Workspace[P].Humanoid.Health==0 then
Plr.TeamColor=(team color)
end
end

Probably not an efficient way to do this, but it should work.

Ad

Answer this question