I’ve been trying to figure this out for some time now, but with no luck. As I want to change the icon of a custom leaderboard system, the script that I’ve been using isn’t doing what I want it to, and since I’m a beginner scripter, I don’t really know how to fix it… I’ve attempted just going back to my old system, but that won’t do unfortunately. Below you may find the script that I’m using, and hopefully this mistake can be rectified
localscript
localPlayer:GetPropertyChangedSignal("Team"):Connect(function()
local function iconSwitch(player, teamArray, iconArray)
for i, value in pairs(TeamArray) do
if localPlayer.Team.TeamColor.Color == TeamArray[1] then
print("Testing")
local Playerlist = player.PlayerGui:WaitForChild("Playerlist")
local Handler = Playerlist.Frame.Handler
local Icon = Handler.Template.Icon
Icon.Image = nil
if Icon then
Icon.Image = iconArray[1]
end