Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I get a player's avatar?

Asked by 6 years ago

I'm trying to get a player's avatar to put into my game, and I'm really not sure how to get it. Everything I try doesn't work and I can only find how to get a user's image.

0
You ever figure this out? IDKBlox 349 — 4y

2 answers

Log in to vote
0
Answered by
Galicate 106
6 years ago

Ok so I literally just posted a question for this and made a script for this...so perfect timing. You can use Web APIs to get the players icon. http://wiki.roblox.com/index.php/Web_APIs

0
I don't want the players Icon I want the player's avatar to be ingame. But i'll see what I can do with the site. CaptainAlien132 225 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

Not quite an exact copy of someone's avatar but close enough. You'll have to fine tune to get the exact replica. Read more about GetCharacterAppearanceAsync, ClearCharacterAppearance and LoadCharacterAppearance

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(Player)
    --Get their UserId from the website
    local userId = 205083914
    local model = Players:GetCharacterAppearanceAsync(userId)

    --Remove what they are wearing(not everything unfortunately)
    Player:ClearCharacterAppearance()

    --Go through the model and load the appearance
    for _, child in pairs(model:GetChildren()) do
            Player:LoadCharacterAppearance(child)
    end
end)
0
I should have explained better, I am trying to paste the local player's appearance onto a dummy. CaptainAlien132 225 — 6y

Answer this question