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
4 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.

wait(0.1)
script.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 — 4y

1 answer

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

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

local Players = game:GetService("Players")

local player = Players.LocalPlayer

-- Fetch the thumbnail
local userId = player.UserId
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)

-- Set the ImageLabel's content to the user thumbnail
local imageLabel = script.Parent
imageLabel.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 — 4y
0
oh, i thought u wanted the avatar because if you click the link it shows you the full body avatar MemezyDev 172 — 4y
0
wait hang on i didnt read the decal part looooooooooool, ill try to look for a solution for u MemezyDev 172 — 4y
0
thanks! bailley5 114 — 4y
View all comments (2 more)
0
solution found? User#34743 0 — 4y
0
no bailley5 114 — 4y
Ad

Answer this question