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

How can I get a player's portrait?

Quick question - I'm looking for a way to put a player's portrait on an ImageLabel or something similar, but haven't found a place where I can direct my game to find the portraits. Should the ImageLabel's source be a certain URL? If so, how can I implement it into a script? Thanks in advance.

2 answers

✓ Accepted answer

To get a player's portrait or character's image you use this URL (with the player's name) which is roblox's web API https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username=

so, this would be

ImageLabel.Image = ("https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username="..player.Name)

The link for the player's id is https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&userId=

so, this would be ImageLabel.Image = ("https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&userId="..player.UserId)

You can get info like this from roblox's documentation on web api which is located here

1 comment

0

yeet

So, you need to get the portrait and upload it as a Decal. Then, you wanna copy the link of the decal and in the ImageLabel, you put the decal into the "Image" Property.

1 comment

0

All right, sounds good. Where can I find a generic link that will work with any player, given I have their player ID?

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