How would I get assets from playerid

Me and my friend are making a game, and we put ourselves into it as npcs. The only problem is that we change our avatars very often, so I was trying to make it so that the body parts and clothing were accurate. I have no idea how to make the body parts accurate. Here is what I was thinking would work:

shirt example:

script.Parent .ShirtTemplate = playerid(000).ShirtId

for body parts i could probably use the animation id things that are in there, but what i need to know is how to get assets from the playerids

You can use the humanoid description system!

local userId = -- your character's userId
local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(userId)

Then just apply this humanoidDescription to your NPC’s humanoid:

local humanoid = -- the NPC's humanoid
humanoid:ApplyDescription(humanoidDescription)
3 Likes

so id put a humanoid desc in the humanoid along with a script?

No just put your userId in the userId variable.

Then put the NPC’s humanoid in the humanoid variable!

1 Like

it works for the body parts not for hair clothing acessories.

Hm, when I do it in my game it works for me.

lemme show u script:

local userId = 928930007
local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(userId)
local humanoid = script.Parent.Humanoid
humanoid:ApplyDescription(humanoidDescription)

Hmm, that should work I do not know why it doesnt…

1 Like

it works now all i had to do is delete my acessories and previous assets :slight_smile: :yum:

1 Like