So I have this GUI with some image labels. I am trying to get all of the players on the team of Bright green and copy their names into string values. But I only want one of each player in 1 image labels string value. There are 6 open image labels with the string value of "PlayName". Can someone help me? I'm not sure how I would do the code.
local labels={list of image labels} local count=1 for _,v in pairs(game.Players:GetPlayers())do if v.TeamColor==BrickColor.new"Bright green"and labels[count]then labels[count].PlayName.Value=v count=count+1 end end
Gets each player on the Bright green team and sets PlayName.Value to their username in order as they are found.