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

Team Change When Death Occurs? (Will this work regardless of change of teams?)

Asked by 8 years ago

The first script works, but idk if it'll work for both, if it does please confirm with me. Title says it all, I'll give you the script down below...

01game.Players.PlayerAdded:connect(function(plr)
02    plr.CharacterAdded:connect(function(char)
03        char.Humanoid.Died:connect(function()
04                plr.Team = game.Teams.Bystanders
05        end)
06    end)
07end)
08 
09--(Idk if this is the same thing regardless of the Teams lol)
10 
11 
12-- THIS SCRIPT WON'T WORK PHO SUM REASON--
13 
14local plr = game.Players.LocalPlayer
15 
View all 22 lines...

1 answer

Log in to vote
0
Answered by 8 years ago

If you're going to credit my answer you might as well just accept it.. xD

1game.Players.PlayerAdded:connect(function(plr)
2    plr.CharacterAdded:connect(function(char)
3        char.Humanoid.Died:connect(function()
4                if plr.Team == game.Teams.Home or plr.Team == game.Teams.Away then
5              plr.Team = game.Teams.Bystanders
6            end
7        end)
8    end)
9end)
Ad

Answer this question