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 grab people's avatar and put it into a GUI?

I'm trying to get other robloxian's avatars and put it onto a screenGUI, but I honestly have no idea how. I tried multiple things like Player.CharacterAppearance but no luck.

1 answer

You want to fetch thier profile picture from the Roblox site. This can be used by using the following link: "http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=200&Format=Png&username=Player"

I like to use a function that will call said image for me, and thus I can call it many times.

function CallPicture(target)
local Id = "http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=200&Format=Png&username=" .. target
-- gathering the image from Roblox
return Id --  return the picture that we just got
end

That function will let you call such by calling the function, with the desired username.

I.e.

pcall(CallPicture(Player)) -- Calling a protect CallPicture with the target is "Player"

I hope I helped you in what you were asking.

EDIT: I have not tested this yet since I am on mobile right now.

2 comments

0

Player needs to be a string. Code fix: imageLabel.Image =CallPicture("Player")

0

I'm new to scripting, so where exactly do I put all of this? In a Local script or script?

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