I am trying to select the players on a certain team. How would I do this?
If you want to create a list of players with a certain TeamColor, iterate through game.Players:GetPlayers()
and check if the player has the specified TeamColor.
If the TeamColor of the team is called "Bright blue" then you can write this:
local blue={} for _,v in pairs(game.Players:GetPlayers())do if v.TeamColor.Name=="Bright blue"then blue[#blue+1]=v end end
which will create a table blue
of players on the Bright blue team.
edit: the face
object is a decal inside the character's head, so to change its Texture for each player on the team, you can index the face and set the texture:
local bluetextureid="rbxassetid://########" -- image id game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if player.TeamColor.Name=="Bright blue" then local face=character:WaitForChild("Head"):WaitForChild("face") face.Texture=bluetextureid end end end
edit: changed to run on CharacterAdded rather than one-time