Your Avatar Picture

Is there a way to make people’s avatar picture show on the left side of your name on the leaderBoard

4 Likes

Yeah you can put a local script inside a imagelabel and put

local content, bool = game.Players:GetUserThumbnailAsync(game.Players.LocalPlayer.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150); script.Parent.Image = content
And it should show the players avatar picture

2 Likes

where does the image label go
30Characters

You can use Players:GetUserThumbnailAsync() to get their avatar image.

Here’s an example of getting an image of their headshot the simple way.

local players = game:GetService("Players")

local avatarImage = players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
--avatarImage is the image of the avatar, just set the Image property of an ImageLabel to avatarImage and there you go

Here’s a more reliable way of getting their avatar, a way to make sure the script doesn’t error out of your control, and making sure that the image is ready.

local retries = 0
local success
local avatarImage
local isReady
repeat
    retries = retries + 1
    success, avatarImage, isReady = pcall(function()
        return players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
    end)
until success and isReady or retries == 3
if success then
    --we can set the image to the avatar here!
else
    --we can't set the image to the avatar, try setting it to a placeholder image
end

I recommend looking into ThumbnailType to get the image you want. HeadShot gets the image of the player’s head and face, AvatarBust gets the image of the player’s upper chest and head, and AvatarThumbnail gets the image of the player’s entire body.

3 Likes

Inside the leaderboard GUI, or if it’s a Billboard GUI then inside that.

And where exactly do I find that at. Because I looked for it before I left yesterday and I couldn’t find the script that runs the player list

And by the way this line

until success and isReady or retries = 3

the “=” has a error

Thanks for pointing that out, I edited my reply and fixed it.

No problem where do I find the player list gui or script and when u answer i have one more question

Can you elaborate more about what you’re looking for?

Like you know how when you run the game and you fully load. And you see the leaderboard and your name. Where do I find the script for the leaderboard to insert that script

Are you talking about leaderstats? If that’s the case you have to create a folder in every player that joins and call it “leaderstats”. You then can put an IntValue in that folder. The name of it will be the name displayed in the leaderstats, and the value will appear next to the player.

I still don’t understand. Are you trying to disable the PlayerList, and when a player presses a key, you want it to show and then disappear after a few seconds?

Ugh nvm. Back to the picture where do I put that script

This belongs in #help-and-feedback:scripting-support.

Well where is your player list, is it a GUI or, I need to know more information