Ad
Log in to vote
0

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

Asked by 5 months 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

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

2 answers

Log in to vote
0
Answered by
CStarLam 513
5 months 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 5 months 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