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

How do I correctly get a character's appearance into an ImageLabel?

I have a script that shows a player's CharacterAppearance that repeats every second. Here's the script (the script is inside an ImageLabel):

local plr = game.Players.LocalPlayer
repeat wait() until plr

while wait(1) do
	script.Parent.Image = plr.CharacterAppearance
end

The problem is that the picture of the character doesn't show up. The output says:

"...Failed to resolve texture format"

So, how do I correctly get a character's appearance into an ImageLabel?

2 answers

✓ Accepted answer

Well, you're using the wrong string. You can use

http://www.roblox.com/Thumbs/Avatar.ashx?username=whyOmustOitObeOme

or

http://www.roblox.com/Thumbs/Avatar.ashx?userid=4330521

Those are the official links for character appearance. In my script, I do: CharImage='http://www.roblox.com/thumbs/avatar.ashx?x=352&y=352&format=png&username=%s';, which enables me to format pictures for players.

To fully fix your script:

local Player = game:service('Players').LocalPlayer
local characterImageFormat='http://www.roblox.com/Thumbs/Avatar.ashx?x=352&y=352&format=png&userid=%d';

-- repeat wait() until plr --// No point. :(

while wait(1) do
	script.Parent.Image = characterImageFormat:format(Player.userId);
end

6 comments

0

Do you mind putting that into the script I wrote for me? Also, it can't be just one player. It has to work for every player to enter the game.

0

Sure. Editing my answer right now.

0

Sweet, it worked! I have no idea how it works, though.

0

The reason that it works is that the ROBLOX character appearance image format is the /Thumbs/Avatar link.

1

Can I suggest not using Usernames and using IDs, because usernames can be changed and IDs can't.

0

@Myst, that's why I posted the link for userId as well.

Sorry, but I don't think you can. A character's appearance isn't even a file. If it was, it would be an obj. file most likely. I see what you're trying to do. Here's my best shot:

script.Parent.Image = "http://www.roblox.com/thumbs/avatar.ashx?x=352&y=352&format=png&username="..plyr.Name

6 comments

1

Btw, the character appearance is the full 3D model, not just the avatar picture.

0

It's not an .obj file, it's an XML file. :P

1

Doesn't matter, really. You get the idea...

0

I know, I was just pointing that out..

1

Damn, I was hoping I was gonna be the only answerer... And then Ditto did his and I gave it a point (It was correct, after all).. Then whyO saw his first... sigh I help others and get nothing.

0

Thumbs up'd. Also, IT'S DIITTO. D I I T T O. I swear, the next person who says "Ditto" is going to get DoS'd.

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