[resolved] Headshots

Headshots.

1 Like

This should work, just change the userId!

Actually, is it possible to just use the username? @AlgyLacey

Not in that link as far as I’m aware, and it’s not available in this API either:

However you can use this to get the Userid from the Name: Players:GetUserIdFromNameAsync

So for that, I would look into this GetUserThumbnailAsync function. From the documentation, you can choose to render the player’s avatar into 3 thumbnail types, which are whole body, chest and up, and face.

I don’t think you can use username instead because there’s a chance for someone’s username to change, but userids always stays constant forever. Storing your players’ data with userids is also a common practice by most developers due to that reason.

You can. Usernames are permanently associated with a UserId. If you pass a username into GetUserIdFromNameAsync, it will return the UserId associated with that username. If you pass a UserId into GetNameFromUserIdAsync, it will return the player’s current username.

Username changes won’t impact the functionality. You just have to work around using the API currently available to you.

I meant to say that you can’t use username for the GetUserThumbnailAsync function. I know that once a username is used, it will only belong to that one associated userid. Like you said though, the possible workaround is to use the available API, such as GetNameFromUserIdAsync.