Hello! I know its been two years and you may have figured this out already, but you are using the json format as said before! so ill help you fix this. There is the basic "get image from url" which basic just loads the image, and if it doesnt find one then ill be a big white box with something in the middle, and there is the complex way, which will check if the image is loaded, and if not, itll set it to some other image.
heres the basic way:
script.Parent.Image= "https://www.roblox.com/bust-thumbnail/image?userId=".. game.Players.LocalPlayer.UserId .."&width=420&height=420&format=png"
This is ok, if you dont want to have a replacment image for the image if the user's icon doesnt load(normally happens when trying to load many)
heres the more complex way:
local thumbnail, loaded= game.Players:GetUserThumbnailAsync(game.Players.LocalPlayer.UserId,"AvatarBust","Size420x420")
if loaded then
script.Parent.Image=thumbnail
else
script.Parent.Image= "http://www.roblox.com/asset/?id=49573081"
end
This will use a function in the "Players" service called GetUserThumbnailAsync to see if the image loads, if so, then use it, otherwise load an alternate photo, in this case i use "http://www.roblox.com/asset/?id=49573081". Heres more on GetUserThumbnailAsync
4 comments
Problem is that it returns JSON formated data, not plain url to the image. You could get it using HttpGet and decode with the JSON functions, but roblox doesn't allow HttpGet requests to roblox website.
So how do I do it??
Yeah there's also a small problem. We tried this before and apparently Roblox simply won't allow stuff from the t cdn servers.
So is this impossible?