The problem with my icons is that it seems entirely clientsided, despite having a server script that fires to all clients… I’ve tried numerous different things over the 24 total hours I’ve been working at it, and nothing seems to work… I am unsure exactly of what to do to get these icons working. Below you will find the code that I’ve attempted.
Serverscript
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconEvent = replicatedStorage.IconChangeEvent
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local playerlist = player.PlayerGui:WaitForChild("Playerlist")
local Handler = playerlist.Frame.Handler
local Icon = Handler.Template.Icon
player:GetPropertyChangedSignal("Team"):Connect(function(): ()
local playerTeam = player.Team
if playerTeam.TeamColor == BrickColor.new("Royal purple") then
Icon.Active = true
Icon.Image = "rbxassetid://18413761813"
elseif playerTeam.TeamColor == BrickColor.new("Bright red") then
Icon.Active = true
Icon.Image = "rbxassetid://18413212927"
elseif playerTeam.TeamColor == BrickColor.new("Dark green") then
Icon.Active = true
Icon.Image = "rbxassetid://18413991987"
elseif playerTeam.TeamColor == BrickColor.new("White") then
Icon.Active = true
Icon.Image = "rbxassetid://18414227286"
elseif playerTeam.TeamColor == BrickColor.new("Electric blue") then
Icon.Active = true
Icon.Image = "rbxassetid://18414094164"
else
end
iconEvent:FireAllClients(playerTeam.TeamColor, Icon.Image)
end)
end)
localscript
iconEvent.OnClientEvent:Connect(function(var1, var2)
if var1 == localPlayer.Team.TeamColor then
Icon.Image = var2
end
end)
refresh()