How do I make code that views someone’s current avatar? (like when you click on someone’s username on the player list, then view their avatar). I saw it in a game but haven’t been very successful with finding how to do it, can someone put me in the right direction?
I think you can use this function “GetCharacterAppearanceAsync” or " GetCharacterAppearanceInfoAsync"
Use player thumbnails
.
As a test, insert a ScreenGui
in StarterGui
. Under that, add an ImageLabel
. Under that, add a UIAspectRatioConstraint
(so the image isn’t deformed). Under the ScreenGui
, insert a LocalScript
:
local image, isReady = game:GetService("Players"):GetUserThumbnailAsync(game:GetService("Players").LocalPlayer.UserId, Enum.ThumbnailType.AvatarThumbnail, Enum.ThumbnailSize.Size48x48)
script.Parent:WaitForChild("ImageLabel").Image = isReady and image or "rbxassetid://0"
no i mean how do i display the ui that is normally shown when you click on someone on the playerlist and then “view avatar”
You have to create the UI yourself using :GetCharacterAppearanceInfoAsync()