So I have a simple issue that I have never had happen before so, I would wonder how to fix it.
I have looked but the fixes I have found don’t help with what I am trying to do.
Script: (Note its a localscript)
local gui = script.Parent
local lead = gui.lead
local lastplrs = 0
local function addplr(plr)
if plr and not lead:FindFirstChild(game.ReplicatedStorage.Plrs.Last.Value) then
local image = gui.Base:Clone()
local content,epic = game.Players:GetUserThumbnailAsync(game.Players:GetUserIdFromNameAsync(plr), Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size420x420)
image.Image = content
image.Size = UDim2.new(0, 420, 0, 420)
image.Parent = lead
image.Visible = true
image.Name = plr
end
end
local function removeplr(plr)
if plr and lead:FindFirstChild(game.ReplicatedStorage.Plrs.Last.Value) then
lead[game.ReplicatedStorage.Plrs.Last.Value]:Destroy()
end
end
game.ReplicatedStorage.Plrs:GetPropertyChangedSignal("Value"):Connect(function()
if game.ReplicatedStorage.Plrs.Value > lastplrs then
addplr(game.ReplicatedStorage.Plrs.Last.Value)
elseif game.ReplicatedStorage.Plrs.Value < lastplrs then
removeplr(game.ReplicatedStorage.Plrs.Last.Value)
end
lastplrs = game.ReplicatedStorage.Plrs.Value
end)