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

How Do I Load An Avatar Image in a Script?

hi, RobloxDeathNoise1, aka OOFYBOI aka RDN1 here, and today i have a question reguarding how to load Avatar images.

how would one go about loading an image from someone's Avatar [full body avatar pictures, only the head and shoulders in frame pictures etc...], is there some service or module or something that loads the picture or something?

thanks, RDN1.

1 comment

0

If the answer helped, mark it as answered.

1 answer

Hi, RobloxDeathNoise1. Since you haven't made some sort of attempt, I will only give you the general outline on how to do so.

  1. You want to create an imageLabel inside of a frame, screenGui, whatever you have.
  2. Insert a local script inside the imageLabel
-- Declaration Section 
local player = game:GetService("Players").localPlayer
local playerGui = player.PlayerGui
local screenGui = playerGui.ScreenGui
local imageLabel = screenGui.ImageLabel

-- Output Section 

imageLabel.Image = "http://www.roblox.com/thumbs/avatar.ashx?x=352&y=352&format=png&username="..game.Players.LocalPlayer.Name

You can edit the script to your preference. Have a lovely day of coding and remember to attempt first, or you will get a lot of hate for not doing so. Accept the answer if it helped you in any way.

5 comments

0

thank you very much for this, i appreciate your help. as for not trying to attempt it to begin with, well im fairly new to coding, so theres no way i wouldve known thats the way it's supposed to be done. more specifically, i dont know how to link to the image. i know how to make GUI elements pretty much. anyways, thanks again, and good day.

0

Hi RobloxDeathNoise1. Everybody starts from the beginning stage. I suggest you look into more roblox wiki for help. Also, it is a custom to accept the answer if it helped you in any way possible. This allows other users see they the question has been answered. Besides, both you and me get points :)

0

id rather use userID instead of name

0

Yup, that works better. But i wrote this on top of my head without actually testing it soo...

0

i tried it earlier with an ImageLabel inside a SurfaceGUI and it worked. haven't tried user ID though. im guessing you would do that with something like this: "game.Workspace.Part.SurfaceGui.ImageLabel.Image = "[the link you provided]".. game.Players.[LocalPlayer/Whoever I'm Trying To Get Id From].Character.CharacterAppearanceId" like that maybe

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