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

i want it so i shows my player's character's face on a Image label but how?

local Players = game:GetService("Players")

local player = Players.LocalPlayer


local face = player.Character
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = Players:GetUserThumbnailAsync(face, thumbType, thumbSize)


local imageLabel = script.Parent
imageLabel.Image = content


this is the script inside the imagelabel but it doesnt do anything when i join the game so idk wat to do

1 comment

0

There's a thing called Endpoints, where you can get images of Assets and Players! Here's a DevForum post about it. https://devforum.roblox.com/t/new-image-endpoints-that-can-be-used-in-game/28182

1 answer

✓ Accepted answer
Image.Image = game.Players:GetUserThumbnailAsync(Player.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size420x420)

There was another way to do it, but I forgot. When I get the link to the page, I'll post it here.

GetUserThumbnailAsync Page

EDIT: I'm pretty sure this needs to be run on the server.

NOTE: Repost from my own answer here

EDIT: How to fix it First, add a RemoteEvent. Name it GetUserId. Set the LocalScript contents to:

script.Parent.GetPlayer:FireServer()

Now add a Script and set the contents to:

script.Parent.GetPlayer.OnServerEvent:Connect(function(player)
script.Parent.Image = game.Players:GetUserThumbnailAsync(player.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size420x420)
end)

3 comments

0

tanx but i dont know at what line i should put this

0

Updated answer to address the above comment.

0

oh ty

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