Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I get a player's avatar?

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.

1 comment

0

You ever figure this out?

2 answers

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

1 comment

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.

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)

1 comment

0

I should have explained better, I am trying to paste the local player's appearance onto a dummy.

This discussion is preserved as it was. New answers, comments, and votes are closed.