How to load a players outfit onto an NPC locally?

What’s happening (I think) is that the invisible clothes are being replaced with other ones (visible) causing it to be seen. Please correct me if I’m wrong.

Oh, although how would I remove that part changed the clothes? All the things in the dummy are this:

image

Don’t mind the Animation script, that’s a whole different thing.

It’s not a part, its in the script lol. It is the part of the script that replaces the clothes. Sorry for not being clear. :frowning:

Oh I’m sorry for not understanding, although which part of the code do I remove to fix this error?

Sorry but I don’t know…

What does this do? I think this might be it.

This just generally detects if the accessories have been loaded in yet, if they haven’t the script will wait until it does happen.

So sorry for late response but I think unfortunately this script needs to be rewritten. Your current script just loads the NPC changing its avatar, but you need to clone the players avatar and put it on the NPC in PlayerGui.

local players = game:GetService("Players")

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

players.PlayerAdded:Connect(function(player)

    local playerGui = player.PlayerGui

	player.CharacterAdded:Connect(function(character)

		local humanoid = character:WaitForChild("Humanoid")
		local description = humanoid:GetAppliedDescription()
        description.Parent = playerGui
		npcHuman:ApplyDescription(description)
	end)
end)

If this does not work I don’t know what will :sick:

This is what had happened

You could try to move your code into a local script inside StarterPlayerScripts and use game.Players.LocalPlayer instead of the first line

Unfortunately this gives an error saying that " PlayerAdded is not a valid member of Player “Players.ekulny”" What should I replace it with?


local player = game.Players.LocalPlayer

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

local character = player.Character

		local humanoid = character:WaitForChild("Humanoid")
		local description = humanoid:GetAppliedDescription()

		npcHuman:ApplyDescription(description)
	end)
end)

Try this

I had used the script:

local player = game.Players.LocalPlayer

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

local character = player.Character

local humanoid = character:WaitForChild("Humanoid")
local description = humanoid:GetAppliedDescription()

npcHuman:ApplyDescription(description)

Although it said there was a problem at line 8 saying that: “Players.ekulny.PlayerScripts.AnimPlay:8: attempt to index nil with ‘WaitForChild’”

Replace it with this:

local character = game.Players:GetPlayerFromCharacter()

Now it says that that line has: “Argument 1 missing or nil” :sweat:

Is there a line? (so sorry this is taking so long :frowning:)

Sorry that I had worded it weird, the line was “local character = game.Players:GetPlayerFromCharacter()”

I think were on the right track by adding this script to StarterPlayerScripts, although I don’t know where to go form here.

I’ve been testing in a local script, and I got the same issue…

Maybe I need to make something to trigger it better? Like the player added event, but something different?