How to load a players outfit onto an NPC locally?

Try putting in StarterCharacterScripts, also ignore my old suggestion, player.character should work

game.Players:GetPlayerFromCharacter() wouldn’t be ideal for finding the character since it is getting the player instead.

Try something like this

local player = game.Players.LocalPlayer

local npc = workspace.Dummy
local npcHuman = npc.Humanoid

local character = player.Character or player.CharacterAdded:Wait()

local humanoid = character:FindFirstChild("Humanoid")
local description = npcHuman:GetAppliedDescription()

npcHuman:ApplyDescription(description)

This would not work because this is in StarterPlayerScripts…

Whoops, my bad :sweat_smile:

I don’t know if it would be possible to do this if you cannot apply a description to a humanoid from a local script. You could try applying the description through the server and then deleting all other players’ dummies from a local script? Just an idea, but correct me if I am wrong.

Sorry but the whole point of this is for Player1 to see their avatar on the NPC and Player2 not to see Player1’s but their own while Player1 can still see theirs. I know its very complicated and took me a while to get it. :tongue:

Maybe this could help, sorry for my misunderstanding…

Sorry guys, I just came back, any suggestions? I’ve also seen that post before, although I’m not sure if it is finished, as the last reply was to take a break.

Also, for when I do put it in StarterCharcaterScripts, it doesn’t work since this error occurs:

image

I guess Humanoid:ApplyDescription doesn’t work locally, if you want a similar effect you could just clone the character, anchor the clone, set the clone’s cframe to the dummy’s cframe and then delete the dummy.

I’ve seen a line like

:GetCharacterAppearanceAsync(player)

Although I don’t know how it works.

Ok time for the long answer of how to do this.

STEP 1. Make a folder in ReplicatedStorage (I like putting these folders in a folder called storage for more organization) called something like CloneFolder. Then put the NPC in the script.

STEP 2. Put a script in ServerScriptService that makes it so when a player joins the game, it clones the NPC. Then use your current script to add the avatar on that NPC.

STEP 3. Move the NPC to PlayerGUI again using a script so no others can see it.

Hopefully this works for you :wink:

I said the wrong thing, so what your telling me to do is to make a folder in replicated storage and put the dummy in, then afterwards make a script to clone the NPC, and use my older script to load the outfit on, and set the parent of the Cloned NPC to Player GUI?

Yep. This works without all the clothing stuff so it should work now.

This is serversided though, and not what they’re asking for.

They are just asking for a script that changes the clothes, not for a ServerSide or ClientSide script

They are asking for a clientsided script, as can be seen here

Oh sorry, guess I miss read that.