GetUserThumbNailAsync() Troubles

I know this function is most likely easy to do for most of the people, but it’s just not working out for me, I’ve made an Admin UI, I wasn’t able to get a Picture of my profile and I have no idea how to use it.

Incase, this is how I did my script I would appreciate the help.

game.Players.PlayerAdded:Connect(function(plr)
	local Repl = game.ReplicatedStorage
	local player = Repl.SOURCE
	
	local cloned = player:Clone()
	
	wait(2)
	
	
	cloned.Parent = plr.PlayerGui.Admin.Main.Audience.ScrollingFrame
	wait(.3)
	print("test")
	cloned.Visible = true
	
	cloned.user.Text = "@"..plr.Name
	cloned.display.Text = plr.DisplayName
	
	cloned.clear.Value = plr.Name

	cloned.plr.Image = GetUserThumbnailAsync(plr.UserId) --This isn't working
end)

You’re missing the thumbnailType and the thumbnailSize parameters.

https://developer.roblox.com/en-us/api-reference/function/Players/GetUserThumbnailAsync

GetUserThumbnailAsync is a function of the Players service, so you will have to rewrite it like this:

game:GetService("Players"):GetUserThumbnailAsync()

For the missing paramaters, you need to write it like this:

game:GetService("Players"):GetUserThumbnailAsync(userId, thumbnailType, thumbnailSize)


2 Likes

GetUserThumbnailAsync is a property of the players service, so you need to do

local Players = game:GetService("Players")
cloned.plr.Image = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)

If you look at my code above, you can see how I included two additional parameters your seemed to have omitted from your code.

thumbType is how much of the character you want to show on the thumbnail. thumbType is an Enum value, so if you’re looking at the image below and you want the thumbnail to be HeadShot, you set thumbType to Enum.ThumbnailType.HeadShot

thumbSize is the quality of the image. Most people set it to 420x420, so you can just do this for that parameter.

local thumbSize = Enum.ThumbnailSize.Size420x420
3 Likes