Attempt to make Player's Icon script

Hello,
I tried to make Player’s Image Icon, but everything I get was only error.

Error:
image

My script:

local Frame = script.Parent

local Player = game.Players.LocalPlayer
local UserID = Player.UserId

local ThumbType = Enum.ThumbnailType.AvatarBust
local ThumbSize = Enum.ThumbnailSize.Size420x420

local Content = game.Players:GetUserThumbnailAsync(UserID,ThumbSize,ThumbType)

Frame.PlayerImage.Image = Content

Hi, here’s what I’m doing in order to find avatar png of someone.

"http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&userId="..player.UserId)
2 Likes

Second argument should be ThumbType instead ThumbSize.
Just swap them places.

local Frame = script.Parent

local Player = game.Players.LocalPlayer
local UserID = Player.UserId

local ThumbType = Enum.ThumbnailType.AvatarBust
local ThumbSize = Enum.ThumbnailSize.Size420x420

local Content = game.Players:GetUserThumbnailAsync(UserID,ThumbType,ThumbSize)

Frame.PlayerImage.Image = Content
2 Likes

Hello,
it worked perfectly, I just wanted Player’s head icon, like that when you open roblox.

Sincerely,
Imagine

use Enum.ThumbnailType.HeadShot

Hello,
thank you for your reply, I don’t know how I could be that stupid.

Have a nice day,
Imagine

1 Like