Basically, i'm just trying to call out the character from each player on the blue team, but haven't been able to script a solid working script. Does anyone know how to do that? My failed attempt is shown below...
Script:
local BlueTeamPlayers = game.Teams.Blue:GetPlayers() local BlueHumanoid = BlueTeamPlayers.Character:findFirstChild("Humanoid") function DeathOfBlueTeam() print('1 player death from blue team...just a test') end BlueHumanoid.Died:connect(DeathOfBlueTeam)
Thanks for your time! ;)
EDIT: Alright, here's the code. I fixed it and added some better explaination.
game.Players.PlayerAdded:connect(function(Player)--hook this up to every player that joins Player.CharacterAdded:connect(function(Character)--hook this up to their character local Humanoid = Character:WaitForChild("Humanoid")--wait for their humanoid Humanoid.Died:connect(function(Died)--hook this up to the humanoid's death if Player.TeamColor == BrickColor.Blue() then--check team print('Someone died on the blue team D:') end end) end) end)