How to import player avatar using userid via script

So I want to import player the avatar into my game to make a scene that shows our avatar, how do I do it?

You can use the Avatar Importer plugin from the Plugins section…
or else you can use MoonAnimator’s feature where you can add in any player’s character using their userid

If you want the player’s avatar to be cloned while the game runs, you can simply write the following code in a serverscript:

game:GetService("Players").PlayerAdded:Connect(function(Player)
         Player.CharacterAdded:Connect(function(Character)
                 Character:Clone().Parent = workspace
                 Character:PivotTo(CFrame.new())  --enter the coordinates here
                 --OR 
                 Character.CFrame = CFrame.new() --enter the coordinates here
         end
end

You can use Players:CreateHumanoidModelFromUserId()

or

Players:GetHumanoidDescriptionFromUserId()

@dragnmer Thank you for the advice!

But i will use GetHumanoidDescriptionFromUserId() for my code, Thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.