How to get players thumbnail? (fixed)

Hi, I am trying to get the Image of the player by that localscript. But I cant figure out how to get that picture. I only have this local script where it chooses a random player picture but here I tried to make it choose a Player that is saved in a value. Maybe someone can help me?

local SonImage = game.ReplicatedStorage:FindFirstChild("SonImage")

SonImage.OnClientEvent:Connect(function(Value)
	local image = game.Players:FindFirstChild(game.Workspace.Son.SonName.Value)

	script.Parent.Image = image:GetUserThumbnailAsync(Value.userId, ThumbnailType, ThumbnailSize)
end)

= image:GetUserThumbnailAsync(Value.UserId, ThumbnailType, ThumbnailSize)

1 Like

I get the error message Argument 1 missing or nil in the output but wait I think its because of value.name

local SonImage = game.ReplicatedStorage:FindFirstChild("SonImage")

SonImage.OnClientEvent:Connect(function(Player)
    local Image = game.Players:FindFirstChild(game.Workspace.Son.SonName.Value)

    script.Parent.Image = Image:GetUserThumbnailAsync(Player.UserId, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size180x180)
end)

That should work! If you want the Son’s picture:

local SonImage = game.ReplicatedStorage:FindFirstChild("SonImage")

SonImage.OnClientEvent:Connect(function(Player)
    local Image = game.Players:FindFirstChild(game.Workspace.Son.SonName.Value)

    script.Parent.Image = Image:GetUserThumbnailAsync(Image.UserId, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size180x180)
end)

Let me know about any problems!

1 Like