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

How do I get a image of a players avatar?

Asked by 7 years ago

I'm not sure how to go about this. I want to get a players avatar into an image and attach it to an ImageLabel GUI. Any help is appreciated. Links to API classes that can help are welcomed.

0
oh. Just find the person you want the image of, save it. Upload it to Roblox, and then set the ImageLabel GUI to that pic. Now, if you want it to be anyone's profile pic, i think you're stumbling to god-level scripting User#19492 0 — 7y
0
Refer to the answers below for your "God level" Scripting lol 4d61736f6e 59 — 7y

3 answers

Log in to vote
0
Answered by
RayCurse 1518 Moderation Voter
7 years ago

You can get the image of an avatar by setting the id of the image to:

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

0
Thank you! 4d61736f6e 59 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

i think this can help, create a script and put in the imageLabel child

char = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}

function player()
    plyr = script.Parent; repeat plyr=plyr.Parent until plyr:IsA("Player"); return plyr
end

function onMouseEnter()
    Leave = false

    repeat wait()
        script.Parent.Important.BackgroundTransparency = script.Parent.Important.BackgroundTransparency -0.1
        if Leave then break end
    until script.Parent.Important.BackgroundTransparency <= 0.3
    script.Parent.Important[string.upper(char[20])..char[5]..char[24]..char[20]]=string.upper(char[16])..char[12]..char[1]..char[25]..char[5]..char[18]..string.upper(char[9])..char[13]..char[1]..char[7]..char[5].." "..string.upper(char[2])..char[25].." "..char[1]..char[1]..char[19]..char[5]..string.reverse(tostring(9)..tostring(6))
end

function onMouseLeave()
    Leave = true

    repeat wait()
        script.Parent.Important.BackgroundTransparency = script.Parent.Important.BackgroundTransparency + 0.1
        if not Leave then break end
    until script.Parent.Important.BackgroundTransparency >= 1
end

script.Parent.MouseEnter:connect(onMouseEnter)
script.Parent.MouseLeave:connect(onMouseLeave)

script.Parent.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username="..player().Name
0
the line 29, is the real script, the pther parts is from my game, just use the line 29 darkzerobits 92 — 7y
Log in to vote
0
Answered by 7 years ago

local player = game.Players.LocalPlayer --The script must be a local script and placed in the image. script.Parent.Image = "http://www.roblox.com/Thumbs/Avatar.ashxx=150&y=150&Format=Png&username="..player.Name

Answer this question