Getting roblox player's avatar with Username/UserId

I’m trying to create NPCs of the player’s friends and I already have a method of finding the player’s friends with GetFriendsAsync, but I’m unsure how I would get their avatar info and instance it into the game. I’ve looked around for a simple answer to this and couldn’t find any.

What function or API can I use to get a player’s avatar data?

3 Likes

Players:GetCharacterAppearanceInfoAsync(userid)

4 Likes

Use this Players | Roblox Creator Documentation

2 Likes

You can get a player’s avatar model using :GetCharacterAppearanceAsync - Players | Roblox Creator Documentation

This will load in given userid’s avatar:

local appearanceModel = game.Players:GetCharacterAppearanceAsync(772462)
appearanceModel.Parent = game.Workspace
4 Likes

This is for the player’s thumbnail if needed
https://developer.roblox.com/zh-cn/api-reference/function/Players/GetUserThumbnailAsync

3 Likes