I’ve been editing this module Custom PlayerList [Supports: Teams/Leaderstats/Group Icons/Custom team order] - #59 by BuchstabensalatTC
I wish to implement within team icon support, and so far I’ve gotten kinda close, but at each opportunity it fails, as in not printing the correct information. Below, you will see my attempts versus actual successful icon implementation. I hope through this I’ll be able to get some help in doing so.
Icon Manager Module (I’m the one trying to add team data)
function IconsManager.UpdatePlayerIcon()
for _, player in pairs(game.Players:GetPlayers()) do
local playerFrame = PlayerList:FindFirstChild(player.Name .. "_Frame")
if playerFrame then
local iconSet = false
local header = playerFrame.PlayerHeader
local backgroundColor = header.BackgroundColor3
if SettingsManager.Settings.groupRanks.enableGroupRanks and SettingsManager.Settings.groupRanks.groupID then
local rankInGroup = player:GetRankInGroup(SettingsManager.Settings.groupRanks.groupID)
local rankData = SettingsManager.GroupRanks[rankInGroup]
if rankInGroup and rankData then
header.Icon.Image = rankData.icon
iconSet = true
end
end
if player.Team then
local whichTeam = player.TeamColor ==
print(whichTeam)
local teamData = SettingsManager.Team[whichTeam]
if teamData then
print(teamData)
header.Icon.Image = teamData.icon
header.Icon.ImageColor3 = teamData.color
iconSet = true
end
end
Here is the SettingsManager script that this line of code is referencing
local SettingsManager = {}
--// Main Settings
SettingsManager.Settings = {
groupRanks = {
groupID = nil,
enableGroupRanks = false
},
leaderstats = {
folderName = "leaderstats",
enable = false
},
teams = {
DisplayingAllTeams = false, --[[If 'false' is specified, then players will see in the PlayerList only those teams that have players.
If 'true' is specified, the players will see a list of all the teams in the game, even those with no players]]
CustomLayoutOrder = false --[[If you want to specify your command order, set this function to 'true' and fill in the list of commands 'CustomLayoutOrder'.
We recommend enabling the 'DisplayingAllTeams' function to make look better custom layout order]]
}
}
--// Group ranks
SettingsManager.GroupRanks = {
[5] = {
icon = "rbxassetid://0"
},
[20] = {
icon = "rbxassetid://0"
},
[255] = {
icon = "rbxassetid://0"
}
}
SettingsManager.Team = {
["Royal purple"] = {
icon = "rbxassetid://18413761813"
},
["Bright red"] = {
icon = "rbxassetid://18413212927"
},
["Dark green"] = {
icon = "rbxassetid://18413991987"
},
["White"] = {
icon = "rbxassetid://18414227286"
},
["Electric blue"] = {
icon = "rbxassetid://18414094164"
}
}