How to make a NPC copy of a player?

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

  1. What do you want to achieve? Keep it simple and clear!

I am attmepting to make an NPC which looks like the player which I can animate. I assumed the best way is to clone the players character directly.

  1. What is the issue? Include screenshots / videos if possible!

I get the error saying the clone variable is nil.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have tried many discords and forums but cant find a clear answer. Ignore the player jakebball2019 thats my username and is just a test character for now.

local LeaderboardService = {}

function LeaderboardService:UpdateThrone()
	local player = game.Players.jakebball2019
	local character = player.Character or player.Character:Wait()
	
	local model = character:Clone()
	model.Parent = workspace
	model.CFrame = character.CFrame
end

return LeaderboardService
1 Like

You have to change Archivable to true to clone a character. Archivable = true

1 Like

It’s because the character’s Achivable property is automatically set to false. Set it to true (on the server), then clone it, and it’ll run fine. However, you will likely need to reinstantiate joints.

1 Like

thanks my guy :smile:

30 chars