I have this custom playerlist, and I want the entries to be able to update all throughout every client when someone changes team. I know I’d have to use GetPropertyChangedSignal, but I’m unsure how to globally make the playerlist colors change.
Below you will find part of the module that might help trying to figure this out.
local function CreateTeamFrame(Team)
local TemplateTeamFrame = TeamFrameTemplate:Clone()
TemplateTeamFrame.Name = Team.Name
TemplateTeamFrame.Parent = PlayerList
local TeamObject = TemplateTeamFrame:FindFirstChild("TeamHeader")
TeamObject.TeamName.Text = DataManager.ShortenTextIfNecessary(Team.Name, 25)
TeamObject.TeamName.TextColor3 = Team.TeamColor.Color
TeamObject.BackgroundColor3 = Color3.fromRGB(1, 1, 1)
TeamObject.Transparency = 0.5
I have found the solution. All I needed to do is add onto the icon module to change the teamcolor of the frame as soon as the icon is added. Like so:
tion IconsManager.UpdatePlayerIcon()
for _, player in pairs(game.Players:GetPlayers()) do
local playerFrame = PlayerList:FindFirstChild(player.Name .. "_Frame")
if playerFrame then
local iconSet = false
local iconFrame = playerFrame
local header = iconFrame:FindFirstChild("PlayerHeader")
if header then
header.BackgroundColor3 = player.TeamColor.Color
end
local backgroundColor = iconFrame.BackgroundColor3