How to make a Dummy in workspace into the player's avatar?

So I am making a horror game with cutscenes in it. Some of which will have the player shown on screen, animated as well. Similar to Piggy’s cutscenes. So what I am trying to do is use the dummy in the image shown bellow as a placeholder. Is there a way to use a script to replace this dummy to the player’s avatar? I will explain more if needed.

2 Likes

I think you can go game.Players.LocalPlayer.Character = (dummy location)

It did not work, I do have a script that I found but it still does not work at the moment.

Here is some code I found from a diffrent post:

local players = game:GetService("Players")
local npc = game.Workspace.Morphs.AvatarMorph

players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(chr)
		npc:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(plr.UserId))
		for i, a in pairs(npc.Parent:GetChildren()) do
			if a:IsA("CharacterMesh") then
				a:Destroy()
			end
		end
	end)
end)

I get the error message: ApplyDescription is not a valid member of Model “Workspace.Morphs.AvatarMorph” - Server - MakeNPCPlayerScript:6

ApplyDescription is property of humanoid. You need to get Dummy’s humanoid and later apply to it your humanoidDescription.

This is example code, which works fine for me.

local Players = game:GetService("Players");

local Dummy = workspace.Dummy; -- your dummy 
local DummyHumanoid = Dummy.Humanoid; -- dummy's humanoid

Players.PlayerAdded:Connect(function(plr)
	local humDes = Players:GetHumanoidDescriptionFromUserId(plr.UserId);
	if(humDes)then
		DummyHumanoid:ApplyDescription(humDes);
	end
end)

Hope this helps.

9 Likes

It works! Thanks for the help!

1 Like