I have a script that switches a player from the "Human" team to the "Zombie" team upon death. Now, this use to work a while back, but now I think it's a bit outdated. I can't seem to spot anything funny about it.
player = script.Parent.Parent.Parent
Humanoid = player.Charcter:FindFirstChild("Humanoid")
Survivor = game.Teams["Survivors"]
Zombie = game.Teams["Zombies"]
function onDeath()
if player.TeamColor == Survivor.TeamColor then
player.TeamColor = Zombie.TeamColor
print("A player has turned")
elseif player.TeamColor == Zombie.TeamColor then
print("Already a zombie")
end
end
Humanoid.Died:connect(onDeath)

1 comment
I'm not very experienced with teams, but maybe it's because you're referencing the color of the teams themselves using TeamColor when you should be using Color? Otherwise, it might be because you're referencing Teams as game.Teams instead of getting the service?