Avatar Image won't load on SurfaceGUI

Hello, thank you for anybody who can help me. I’m trying to make a board that displays everything about somebody, this is suppose to be a test for me to understand the values of, for example, display names, accountages, etc.

When I make a ImageLabel and insert a code in it (I’ll link it at the end.) it doesn’t seem to want to load, I have tried everything and there’s no errors in Console for some reason. Here’s what happens.

image

Here’s what I put inside the Local Script inside the Image Label:

script.Parent.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&userId=" .. game.Players.LocalPlayer.UserId

Thank you for anybody who can help me.

You should use :GetUserThumbnailAsync() to achieve this.

local plr = game.Players.LocalPlayer
local userID = plr.UserId
local thumType = Enum.Thumbnail.Type.AvatarBust -- Change it to what type you want
local thumSize = Enum.ThumbnailSize.Size420x420 -- Change it to what size you want
local content = game.Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)

script.Parent.Image = content

Local Script never work in Workspace.

I tried this, in a script and a local script, but nothing is working.

So what should I do? use a normal script?

I tested this out and I know the issue,

Basically, put your SurfaceGUI inside StarterGUI, then go to your surfaceGUI’s properties, click on adornee, then click on the part you want it to appear on. After that, put the script I sent in your surfaceGUI.

image

Sadly it’s still not working, it’s just not displaying the Avatar Image, even after doing the following:

Can you show me an image of where you surfaceGUI’s are located?

Okay.
image

Make sure you have changed your local script to this too.

And set your surfaceGUI’s adornee to the part.

image

Apologies, there was a slight error in my script:

local plr = game.Players.LocalPlayer
local userID = plr.UserId
local thumType = Enum.ThumbnailType.AvatarBust -- Change it to what type you want
local thumSize = Enum.ThumbnailSize.Size420x420 -- Change it to what size you want
local content = game.Players:GetUserThumbnailAsync(userID, thumType, thumSize)

script.Parent.Image = content

Thank you, here’s the results.

Is there a way to make it to look like this though?
image

Change “AvatarBust” to “AvatarThumbnail”.

Thank you so much, you’re the actual best frfr.

image

1 Like