Copy appearance of player on a NPC

Greetings!
I will try to solve 2 problems into 1 topic.

Copying the HumanoidDescription of LocalPlayer to NPC

I’ve tried to do this by myself but sadly i have no idea from where to start or how to start.
To begin with i tried to get the client’s user and print it out in output .

local LocalNPC = game.Workspace.LocalNPC.Humanoid
local char = LocalNPC:WaitForChild("Character")
local player = game:GetService("Players")
local LocalID = player.LocalPlayer.UserId

print(LocalID)

game.Players.PlayerAdded:Connect(function(player)
	     print(player.UserId)
	LocalNPC:GetHumanoidDescriptionFromUserId(player.UserId)
end)

Script in ServerScriptService

Basically all i want to achieve in this section is to get the player’s look to be copied and pasted into the NPC’s look.

Copying player friend’s look in NPCs

I want so the selected NPCs to have the look of the user’s random friends basically but , as i said, i don’t know how to start and from where to start.

User’s model is called LocalNPC and the friend models are LocalFriends

Thank you everyone! :heart:

6 Likes

First off, you have to apply a HumanoidDescription to a humanoid, and to get the player’s HumanoidDescription, you have to call GetHumanoidDescriptionFromUserId() which is a function of the players service, not humanoids. So you just have to do this.

localNPC:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(player.UserId))

As for getting the player’s friends, you should consider players:GetFriendsAsync(). Here’s the documentation in the developer hub. I never used this function before, so I can’t really help you out further. Still, you should consider looking into this.

9 Likes

It works but i have a different problem now. I want the NPC to respect the Height, Depth , HeadScale and so on from the original dummy.

Before / After loading the description.
image
I tried to copy all the scales from the loaded avatar and edit them. I’ve also tried to edit them from the script and i get the error " ~ ~ ~ is not a part of Humanoid" with each scale.

local LocalNPC = game.Workspace.LocalNPC.Humanoid

game.Players.PlayerAdded:Connect(function(player)
	LocalNPC:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(player.UserId))
	wait()

	LocalNPC.BodyHeightScale = 1.4
	LocalNPC.BodyProportionScale = 1.1
	LocalNPC.BodyWidthScale = 1.2
	LocalNPC.HeadScale = 1.3
	
	print("Proportions applied succesfully")
end)

Got the same tiny avatar

1 Like

There’s a property of Humanoids called “AutomaticScalingEnabled”. Try unchecking it in the properties window.

3 Likes

After 3 hours of trying to find a way to fix this issue before attempting to edit the Desc Info, ur a LEGEND.

AMAZING! Just incredible! Really happy to find this post! It helped a lot!

3 Likes