Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I use SurfaceGui and GetUserThumbnailAsync?

Hi all. I have been trying for hours... to create a part in game, where when a player enters the game they will see a picture of themselves on the wall.

I have tried lots of scripts, including the one on the developers site, but it is still not working.

I have it in a localscript, in an Imagelabel, in a SurfaceGUI, in a part.

I have tried putting it in other places, and also in a regular script (but this gave me errors).

I have tried various other snippets of code online, but absolutely nothing is working.

Here is the code off the developers site. Please can someone please tell me what I am doing wrong? I am at my wits end.

Thank you

local Players = game:GetService("Players")

local player = Players.LocalPlayer

-- Fetch the thumbnail local userId = player.UserId local thumbType = Enum.ThumbnailType.HeadShot local thumbSize = Enum.ThumbnailSize.Size420x420 local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)

-- Set the ImageLabel's content to the user thumbnail local imageLabel = script.Parent imageLabel.Image = content imageLabel.Size = UDim2.new(0, 420, 0, 420)

1 answer

Hey Tilley,

I recommend you make a SurfaceUI in StaterGui and make it Adornee to your desired brick. This will make the local script functional. You use the same surface Ui just transfer it into the StaterGui folder and go into properties and make the Adornee value set to your part.

Cheers,

orcazate

2 comments

0

oh. wow. You are amazing. I am absolutely so so so so grateful! Thank you :)

0

@Tilley if you could approve this as the accepted answer it would help many others

This discussion is preserved as it was. New answers, comments, and votes are closed.