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

How do I use an ImageLabel to display a Character's Avatar?

Asked by 10 years ago

I'm scripting a Stats Gui for an RPG I'm making, and I want to know what code to use to set an ImageLabel to display the user's Character via a LocalScript. Any help with this?

1 answer

Log in to vote
1
Answered by 10 years ago

I think this should work. I used it in my game, I'm not sure if this is how you would change it with localscripts ( I haven't dealt with localscripts much)

--Assuming the script is inside the ImageLabel
script.Parent.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username="..game.Players.LocalPlayer.Name
--Thanks to the comments for finding my small mistake

0
It would be "game.Players.LocalPlayer" rather than just "LocalPlayer" duckwit 1404 — 10y
Ad

Answer this question