Leaderboard which loads the characters Roblox profile icon

Hello Developers,

I am in the process of making a Roblox Global leaderboard which I will be using for my game, I was wondering if it is possible to load the players on the leaderboards Roblox icon, if anyone can send information or link any articles regarding this I would appreciate it

-Veesom

Players:GetUserThumbnailAsync fetches a content URL of an image of the specified player’s avatar. You can specify the thumbnail type and size.

3 Likes

How can I make it so it gets the image from the player being on the board?

1 Like

Set the relevant ImageLabel’s ImageLabel.Image to the content ID returned by the function.

The Developer Hub’s code sample explains this pretty well:

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)
4 Likes

I know this was already solved, but if you would like more info on making leaderboards, I made a tutorial on it: How to make a global leaderboard

1 Like