How To Make NPC Look Like Local Player

Whats up Dev Forum, Im trying to make a script right now where if a player joins a rig I have in game looks like that player for just them if you know what I mean. For example if i join the rig looks like me for me only and if another player joins the rig looks like them for them only but still looks like me for me. Kind of confusing but I hope that helps thanks!

34 Likes

Use a local script, and Use Player:GetHumanoidDescriptionFromUserId(), on the player. Then use Humanoid:ApplyDescription() on a Empty rig, and boom, the NPC is the player.

8 Likes

if i do it that way will it look like each player that joins for just them?

2 Likes

Local scripts run locally, or on the client. They don’t transfer this information to the server. Therefore, no

4 Likes

doing what u said i came up with this local localPlayer = game.Players.LocalPlayer
local humanoid = script.Parent.Humanoid

local function applyAppearance()
local humanoidDescription = localPlayer:GetHumanoidDescriptionFromUserId(localPlayer.UserId)
humanoid:ApplyDescription(humanoidDescription)
end

applyAppearance()
but it doesnt work for some reason i thought it would.

1 Like

For future posts, format your code like this: You would use the ```` ← 3 of those on the front and back

local localPlayer = game.Players.LocalPlayer
local humanoid = script.Parent.Humanoid

local function applyAppearance()
local humanoidDescription = localPlayer:GetHumanoidDescriptionFromUserId(localPlayer.UserId)
humanoid:ApplyDescription(humanoidDescription)
end

applyAppearance()

And this script is meant for a Server script. This script parent is set to workspace which isn’t a valid container for local scripts. Instead, use a local script, inside StarterPlayer < StarterPlayerScripts and use this code below

local localPlayer = game.Players.LocalPlayer
local humanoid = game.Workspace:FindFirstChild("NPC").Humanoid --Replace with pathway to Humanoid of the NPC. 

local function applyAppearance()
GetHumanoidDescriptionFromUserId
local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(localPlayer.UserId)
task.wait(0.5)
humanoid:ApplyDescription(humanoidDescription)
end

applyAppearance()
3 Likes

16:04:56.042 GetHumanoidDescriptionFromUserId is not a valid member of Player “Players.DemonicPandazYT” - Client - LocalScript:5

1 Like

local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(localPlayer.UserId)

16:08:46.325 Humanoid::ApplyDescription() can only be called by the backend server - Client - LocalScript:7

local humanoid = game.Workspace:FindFirstChild("DancingRig").Humanoid --Replace with pathway to Humanoid of the NPC. 

local function applyAppearance()
	local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(localPlayer.UserId)
	task.wait(0.5)
	humanoid:ApplyDescription(humanoidDescription)
end

applyAppearance()
1 Like

to give you context on what im trying to do I want 1 rig that looks like every player in the server and a camera facing the rig while it dances showing you that you won kind of like daycare story.

3 Likes

im trying to do this because i dont want to make 12 different winner boxes and 12 different cameras for the specific players in the game.

local Oldhumanoid = game.Workspace:FindFirstChild("DancingRig").Humanoid --Replace with pathway to Humanoid of the NPC. 

local function applyAppearance()
	local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(localPlayer.UserId)
	task.wait(0.5)
    Oldhumanoid:Destroy()
    local Newhumanoid = Instance.new("Humanoid", game.Workspace:FindFirstChild("DancingRig"))
	Newhumanoid:ApplyDescription(humanoidDescription)
end

applyAppearance()

is this script staying in starter player scripts?

yes, and still a local script in starterplayerscripts

alright getting close so the problem im encountering now is the rig doesnt have my shirt on or my pants

Make sure the NPC has no clothing instances that override whats being added. Can you go into a play test and select the npc and send me the explorer hierarchy of the NPC. Also check if there is pants and a shirt instances, and if they have a ShirtID and PantsID

its just the rig nothing else in it.

^

chars limit ahhhhh

my bad dude i didnt fully read that part just skimmed across it yeah give me a minute ill do it now