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

How to get a players avatar picture?

Asked by
Galicate 106
6 years ago
function joined(player)
    script.Parent.Image = http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=player.Name"):format("DigitalVeer
end

game.Players.ChildAdded:connect(joined)

the only problem with this is that the first slash after http: says i have a syntax error. THis is the only knowledge i could find of this topic..So please help.

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Hello there friend. So what's going on here is that the Image property you are looking to edit requires a string representation of where to find the asset.

Here is how I would write that string.

script.Parent.Image = ("http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=%s"):format("DigitalVeer")

(you can read about string.format here)

You mentioned that you had a hard time finding more information about this subject.

0
This also did not work. Galicate 106 — 6y
Ad

Answer this question