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

How to make a decal of your own avatar?

Asked by 7 years ago

I'm making a game with an inventory and I want a little decal which should look exactly like the person currently vieuwing that decal. Something like an avatar of yourself that changes if you change. Is there any possible way to do this? Any help is appreciated. :)

0
Regarding your comment on my answer, the picture doesn't change because the server has to update the picture to match the avatar on the site. Unfortunately, that's as far as we can get scripting-wise, so you'll have to stick with it. Sorry TrippyV 314 — 7y
0
Ok, thx anyway, I learned something new. :) blacksmiley0 19 — 7y

1 answer

Log in to vote
0
Answered by
TrippyV 314 Donator Moderation Voter
7 years ago

Make sure to make an attempt and post some code next time you ask for help.

Besides that, here's what you need:

"http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=200&Format=Png&username="

You can use this in a script like so with an ImageButton, ImageLabel, or any other picture displaying instances.

Note: "object" should be the instance you're changing the image of (Decal, ImageButton, etc.)

For GUIs:

object.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=200&Format=Png&username=" .. game.Players.LocalPlayer.Name -- You can change this to anything, like a variable

For Decals and/or Textures:

object.Texture = "http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=200&Format=Png&username=" .. game.Players.LocalPlayer.Name -- You can change this to anything, like a variable

If there are any errors I'd be happy to help you debug them.

0
Thanks a lot! I used this script and it displays your avatar, but when I change clothing (In Game) the avatar doesn't change. This is probably because the picture you are getting is from roblox, not from the game itself. Is there a way you could do this? blacksmiley0 19 — 7y
Ad

Answer this question