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

How to get the player's avatar image into GUI?

I'm trying to make a GUI that has the player's avatar image on it. I have seen it in games like Bloxburg, but have no idea how to do it. Any idea how to do it?

1 answer

You will want to use one of these API endpoints that can be found here.

Regular

https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username=ROBLOX

https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&userId=1

Endpoints

https://www.roblox.com/bust-thumbnail/image?userId=1&width=420&height=420&format=png

https://www.roblox.com/headshot-thumbnail/image?userId=1&width=420&height=420&format=png

https://www.roblox.com/outfit-thumbnail/image? userOutfitId=1&width=420&height=420&format=png

https://www.roblox.com/asset-thumbnail/image?assetId=1&width=420&height=420&format=png

For example if I have a player object player.

local player

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

imagelabel.Image = "https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&userId="..player.UserId

2 comments

0

how come i never knew that ;-;

0

I just discovered it this afternoon. Always remember to look for things that might lead you to the right answer. For example, I searched for "Web Apis" on this one after I saw that a search for "avatar" wasn't giving me anything.

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