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 make a script that changes a person's team when they die?

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

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.

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