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

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

Asked by 6 years ago

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

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

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
0
how come i never knew that ;-; greatneil80 2647 — 6y
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. User#18718 0 — 6y
Ad

Answer this question