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

How do I grab people's avatar and put it into a GUI?

Asked by 8 years ago

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

Log in to vote
2
Answered by 8 years ago

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.

0
Player needs to be a string. Code fix: imageLabel.Image =CallPicture("Player") TheDeadlyPanther 2460 — 8y
0
I'm new to scripting, so where exactly do I put all of this? In a Local script or script? JustDefy 0 — 8y
Ad

Answer this question