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

Image not loading character?[Solved]

Hello, I need help loading an image for my RPG. I thought of getting the ID of the player and then connecting that up with a Roblox URL. However, the image does not show up and shows up: ContentProvider:PreloadAsync() failed for rbxassetid://99666917 Is there any way to fix this problem?

local player = game.Players.LocalPlayer
local charImage = script.Parent
charImage.Image = "http://www.roblox.com/asset/?id=" .. player.UserId

The hierchy is that a BackpackScreen is being cloned from ReplicatedStorage to PlayerGui. Then inside the GUI, there is a frame which is named BackpackFrame. Inside BackpackFrame, there are other objects, but I'll say the main one, an image label named CharApperance.

1 answer

✓ Accepted answer

This is not how you would get a character's picture. You'd need to use this. Here is an example to get a picture for a 200x200 image label.

local id = game.Players.LocalPlayer.UserId
local image = game.Players:GetUserThumbnailAsync(id, 2, 1)
game:GetService('ContentProvider'):PreloadAsync({image}) 

Keep in mind that :GetUserThumbnailAsync is a yield function.

Hope this helps!

3 comments

0

Would this work if I were to put this inside the Image property of an ImageLabel?

0

Yes.

0

How would I do it? I did everything that you put, how would I send what would be loaded into the Image property

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