Ad
Log in to vote
0

[GUI] How do I add an imago of a player?

Asked by 1 year ago

How do i put an image of a player into an image label. I dont want to make lots of decals for the images. i know its possible but how. I cant find anything online

2 answers

Log in to vote
0
Answered by
CStarLam 541
1 year ago

Here! Try this link in the code below. But make sure you configure the size for the image itself first!

local playerImageSize = 100 -- This must be a perfect square!
local playerName = game.Players.LocalPlayer.Name -- Hopefully you're using a Local Script!

script.Parent.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x="..playerImageSize.."&y="..playerImageSize.."&username="..playerName

Any questions? Leave them in the comments. Thanks!

Ad
Log in to vote
0
Answered by 1 year ago

ROBLOX has avatar images that you can use, you can easily edit their properties such as size and who is in the image.

Here's some example code I made

player = game.Players.LocalPlayer.UserId
-- You can edit who the player is above.

script.Parent.Image = "https://www.roblox.com/headshot-thumbnail/image?userId="..player.."&width=420&height=420&format=png"

script.Parent.Image = "https://www.roblox.com/asset-thumbnail/image?assetId="..player.."&width=420&height=420&format=png"

script.Parent.Image = "https://www.roblox.com/bust-thumbnail/image?userId="..player.."&width=420&height=420&format=png"

Answer this question



Ad