How do i make a dummy clone a person's avatar so i can animate it?

Beginner developer here, i want to make a script (it’s gonna be a 1 player game) where it spawns a dummy with the same accessories and clothings as the player that joined, how can i achieve this?

I’ve tried different solutions offered here such as getplayerid, but as a beginner, everything is confusing here and i dont really know where to start

It would also help if i got told where i need to store the script (such as in Players folder or another one? thanks

1 Like

You probably want to use a server script to achieve this, located in ServerScriptService (optimal location for scripts).

You could probably just clone the player’s character, or, if that doesn’t work for some reason, use Players:GetCharacterAppearanceAsync().

local players = game:GetService("Players")

local function playerAdded(player)
    local success, response = pcall(
        players.GetCharacterAppearanceAsync, players, player.UserId
    )
    if success then
        local newChar = response
    else
        warn(response)
    end
end

players.PlayerAdded:Once(playerAdded)
2 Likes

do i need to make a dummy for this to work?, sorry for the dumb question

Im pretty sure this script is right but i might be missing something as only inserting this into serverscriptservice doesnt make a dummy appear

edit: please take note i have no experience in pogramming

The error i get in the developer console is

“Downloading asset failed for asset id 5722947559, is the asset id correct and is the asset type model?”

For this specific method, no.

Try this script that simply clones the player’s character:

local players = game:GetService("Players")

local function playerAdded(player)
    local char = player.Character or player.CharacterAdded:Wait()
    local animateChar = char:Clone()
    -- Do what you will with animateChar
end

players.PlayerAdded:Once(playerAdded)