Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I use SurfaceGui and GetUserThumbnailAsync?

Asked by 3 years ago

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

Log in to vote
0
Answered by
orcazate 170
3 years ago

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

0
oh. wow. You are amazing. I am absolutely so so so so grateful! Thank you :) Tilley_Eyelash 0 — 3y
0
@Tilley if you could approve this as the accepted answer it would help many others orcazate 170 — 3y
Ad

Answer this question