Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I get a player's portrait?

Asked by
J_98482 18
5 years ago

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

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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

0
yeet bhqpping 80 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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.

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

Answer this question