Player avatar in to decal

  1. I am making a game where in the first part of the game the player is being interrogated. As a small detail in the game, i wanted to add a poster with the player’s avatar.

  2. I’ve looked at a lot of posts on the devforum but haven’t found an answer to this question.

  3. I have tryed this but and made something wrong.

local Players = game:GetService(“Players”)
local Player = Players.LocalPlayer
local Usern = script.Parent.username

local ID = Players:GetUserIdFromNameAsync(Player.UserId)

Usern.Value = ID

local content = game.Players:GetUserThumbnailAsync(script.UserID.Value, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size150x150);
script.Parent.Texture = content

Scripts dont have “game.Players.LocalPlayer” that is only accessible by the client
With a LocalScript inside of the StarterGui or StarterPlayer you can give the path to the part and change the texture locally.

Ty it worked!
Putted script in StarterGui and edited it a bit.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.