I have a script that shows a player's CharacterAppearance that repeats every second. Here's the script (the script is inside an ImageLabel):
1 | local plr = game.Players.LocalPlayer |
2 | repeat wait() until plr |
3 |
4 | while wait( 1 ) do |
5 | script.Parent.Image = plr.CharacterAppearance |
6 | 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?
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:
1 | local Player = game:service( 'Players' ).LocalPlayer |
2 | local characterImageFormat = 'http://www.roblox.com/Thumbs/Avatar.ashx?x=352&y=352&format=png&userid=%d' ; |
3 |
4 | -- repeat wait() until plr --// No point. :( |
5 |
6 | while wait( 1 ) do |
7 | script.Parent.Image = characterImageFormat:format(Player.userId); |
8 | end |
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:
1 | script.Parent.Image = "http://www.roblox.com/thumbs/avatar.ashx?x=352&y=352&format=png&username=" ..plyr.Name |