How do i make a NPC look like a player ingame. I've done a ton of searching and seem to not get the answer. I'm trying to make it animated too at the same time.
Example: https://prnt.sc/kld0zl (a photo shows that a player is next to a model that looks just like them but without a hat.)
script:
game.Players.CharacterAdded.RBXScriptSignal:Connect():Connect(function(plr)
local cchar = plr.Character:Clone()
cchar:MoveTo(game.Workspace.charspawn.Position)
cchar.HumanoidRootPart.Anchored = true
end)
Error: CharacterAdded is not a valid member of Players
You can check out the PlayerAdded event here. You must set the Archivable property to true before you can edit a players character.
local players = game:GetService("Players") local function clone(character) character.Archivable = true local cloned = character:Clone() character.Archivable = false return cloned end local function move(clone, newpos) local torso = clone:FindFirstChild("HumanoidRootPart") -- make sure torso is there if torso then torso.Anchored = true clone:MoveTo(newpos) -- move clone end end players.PlayerAdded:Connect(function(player) -- When a player joins player.CharacterAdded:Connect(function(character) -- When a players character loads delay(player.DataReady, function() -- seems to help wait for everything to load local clonedCharacter = clone(character) -- clone it clonedCharacter.Parent = workspace -- parent it move(clonedCharacter, Vector3.new(0,5,30) ) end) -- move it end) end)