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

How to get a local player's avatar and put it on a decal?????

Asked by
bailley5 114
5 years ago

So I did some research to see if I could find a script that would get the players avatar and change the image to it. I found this script which doesn't work, I put a local script in a decal tell me if this is wrong.

1wait(0.1)
2script.Parent.Image = "http://www.roblox.com/thumbs/avatar.ashx?x=352&y=352&format=png&username="..game.Players.LocalPlayer.Name
0
I dont think this logic is possible, if theres no search on the developer hub then its impossible to do. Only option is to use :getuserthumbnailaysnc JesseSong 3916 — 5y

1 answer

Log in to vote
1
Answered by
MemezyDev 172
5 years ago
Edited 5 years ago

you can do the function :GetUserThumbnailAsync(), i dont know much about it the code below is from the wiki

01local Players = game:GetService("Players")
02 
03local player = Players.LocalPlayer
04 
05-- Fetch the thumbnail
06local userId = player.UserId
07local thumbType = Enum.ThumbnailType.HeadShot
08local thumbSize = Enum.ThumbnailSize.Size420x420
09local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
10 
11-- Set the ImageLabel's content to the user thumbnail
12local imageLabel = script.Parent
13imageLabel.Image = content

you can read more about it at https://developer.roblox.com/en-us/api-reference/function/Players/GetUserThumbnailAsync

0
Thanks but I wasn't looking for how to put a player's avatar on a imagelabel. However I modified it to make it "work" woth the decal, sadly It didn't work :c bailley5 114 — 5y
0
oh, i thought u wanted the avatar because if you click the link it shows you the full body avatar MemezyDev 172 — 5y
0
wait hang on i didnt read the decal part looooooooooool, ill try to look for a solution for u MemezyDev 172 — 5y
0
thanks! bailley5 114 — 5y
View all comments (2 more)
0
solution found? User#34743 0 — 4y
0
no bailley5 114 — 4y
Ad

Answer this question