HumanoidDescription of an NPC not applying correctly to a player

I’m making a tool that changes players appearance to NPC appearance the player clicked on.
I’m doing this with getting a HumanoidDescription from an NPC with a GetHumanoidDescription() on the Humanoid and applying to the players humanoid.
The error seems to be that the HumanoidDescription of the NPC is empty. (Check image below)
Both the NPC and player are found on the server, all of security options are on (HTTP requests, API Services etc)

This is the code (Server Script), event is fired by clicking on a model which contains a humanoid


:

local changeEvent = game:GetService("ReplicatedStorage"):WaitForChild("changeLook")
local Players = game:GetService("Players")


changeEvent.OnServerEvent:Connect(function(player, otherCharacter)
	
	local char = workspace:FindFirstChild(otherCharacter.Name) or workspace:FindFirstChild(otherCharacter.Parent.Name)
	local otherhumanoid = char:WaitForChild("Humanoid")
	
	local humanoidDescription = otherhumanoid:GetAppliedDescription()
	
	workspace:FindFirstChild(player.Name):WaitForChild("Humanoid"):ApplyDescription(humanoidDescription)
	
	
end)

:GetAppliedDescription() doesn’t really provide much functionality beyond being a safe call to check if a Humanoid contains a HumanoidDescription. It doesn’t poll the Humanoid's model and find assets or anything, it just provides a reference to the HumanoidDescription contained inside the queried Humanoid or a blank one if none exists.

In your case, this means that you will need to manually create a HumanoidDescription that matches what the model is wearing and put it within that model’s Humanoid. That should solve your problem, although it is tedious.

1 Like

Thanks a lot for reaching out, I really appreciate your help.
What type of a solution would you use, since this has to be hard coded, I already know how to copy over accessories, copy them over to a table then use Humanoid:AddAccessory() on the player humanoid, but I’m not sure about the clothes, should I find players shirt for example destroy it and make a new instance with the NPC’s ID? Thank you in advance

You can still use HumanoidDescriptions, you just have to populate their fields on your own and put them into the models’ Humanoids.

This would likely need be done completely manually by entering in the assets IDs into their corresponding HumanoidDescription properties, or it could be automated if you know how to get the assets IDs from each found accessory/clothing item; however, I don’t personally know how to do that.

Cloning can work, but it depends how in-depth what you’re trying to do is. If you only care about accessories and clothing, destroying the clothing and accessories on the player’s character and recreating new ones from the target model is reasonable. If your project supports different rig types or scales, or if you need to change body types and/or animations, I would then recommend a HumanoidDescription route instead.

1 Like