NPC Spawner (Copies avatar)

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want a tool that spawns NPCs and copies accessories and body color, and also clothing from the player onto the NPC.
  2. What is the issue?
    I do not know how to.

One way that might be easy is to just clone the whole character so that it has all the accessories. To clone the character you need to make it archivable. Here is a quick script I wrote that will make a clone of each player’s character that joins, rename it, and place it in the workspace.

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	player.CharacterAppearanceLoaded:Wait()
	
	local character = player.Character
	character.Archivable = true
	local clone = character:Clone()
	character.Archivable = false
	
	-- if you don't need these scripts in the clone, you can uncomment these two lines
	--clone:FindFirstChild("Health"):Destroy()
	--clone:FindFirstChild("Animate"):Destroy()
	
	local newName = player.DisplayName .. " Clone"
	
	clone.Name = newName
	clone:FindFirstChild("Humanoid").DisplayName = newName
	clone.Parent = workspace
end)

Hope this helps :slight_smile:

NPCs and copies accessories and body color, and also clothing from the player onto the NPC.

You just need to clone the tool holder’s character model to achieve this.

local Script = script
local Workspace = workspace
local Tool = Script.Parent --Script inside the tool.

local function OnActivated()
	local Character = Tool.Parent --Fetch character from tool.
	if not Character then return end
	Character.Archivable = true --Allows character to be cloned.
	for Index = 1, 4 do
		local Clone = Character:Clone()
		Clone:PivotTo(CFrame.fromOrientation(0, math.rad(Index * 90), 0) * CFrame.new(Character:GetPivot().Position + Vector3.new(0, 0, -10)))
		Clone.Tool:Destroy()
		Clone.Parent = Workspace
	end
	Character.Archivable = false --No longer need to clone.
end

Tool.Activated:Connect(OnActivated)

This will create 4 clones that circle the tool’s holder.

1 Like