How to get the Uniform ID?

Hi, I am pretty sure this is pretty simple but really haven’t found a way to get it. So am trying to use the endpoints @WebGL3D Implemented and withing one of them there is one that requires the UniformID. So my question is how do i get it? (here is the post btw incase you’re curious New image endpoints that can be used in-game!)

If by uniform ID you mean outfit ID, you can use https://avatar.roblox.com/v1/users/{userId]/outfits.

1 Like

yeah, that definitely helps but not quite what am looking for. Any idea how to get the ID of the current uniform a player is wearing? since the end point you provided, provides a huge list full of all your uniforms.

That’s not quite how it works. You don’t really wear outfits - you wear the contents of those outfits. If you really wanted to, you could compare the contents of the player’s current avatar (https://avatar.roblox.com/v1/users/{userId}/avatar) with every one of their outfits until you find (or don’t find) a match.

What exactly is your use case? Are you just trying to get an image of a player’s avatar?

Yeah, thats basically what am trying to do using Web’s endpoints. And since i really don’t know how to get the uniformID which is needed in one of the endpoints, i had to ask.

Try this, if your trying to get the player’s avatar, make an image in the UI and put this code in;

script.Parent.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&userId=" .. game.Players.LocalPlayer.UserId

That indeed did work. Problem is, Since the resolution of the image is quite small, I can’t really use it in a big image label since it will look blurry/distorted Any other endpoints or ways to fix this? (Thanks a bunch for that endpoint btw)

So you’re not looking for a “Uniform ID” - you’re looking for an avatar image? Guess that’s a slight error in articulation, though using those words would certainly help to solve your problem a little quicker.

There’s actually a function specifically for this use case that superseded using the raw endpoint, which is GetUserThumbnailAsync. Have a look at its documentation - it allows you to specify the user you wish to receive a thumbnail of, a thumbnail type and a thumbnail size.

Types of thumbnails you can get (ThumbnailType Enum):

  • AvatarBust: Head and upper chest
  • AvatarThumbnail: Entire avatar
  • Headshot: Only the head

Minimum size you can get for a user thumbnail is 48x48, maximum is 420x420. You can get these by using the ThumbnailSize Enum while writing the function.

Something to keep in mind is that this is a web call. I would suggest wrapping it in a protected call just in case it throws an error should the endpoint not be available.

local Players = game:GetService("Players")
local success, Content, CanUse = pcall(Players.GetUserThumbnailAsync, Players, PlayerId, Enum.ThumbnailType.AvatarThumbnail, Enum.ThumbnailSize.Size420x420)

if success then
    -- Handle
end
4 Likes

Was completely clueless that a function like this existed. Thank you!

2 Likes