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

Image not loading character?[Solved]

Asked by 6 years ago
Edited 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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!

0
Would this work if I were to put this inside the Image property of an ImageLabel? saSlol2436 716 — 6y
0
Yes. hiimgoodpack 2009 — 6y
0
How would I do it? I did everything that you put, how would I send what would be loaded into the Image property saSlol2436 716 — 6y
Ad

Answer this question