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

how to load a players character with a player id?

how do you load a players Character with a player id with scripts? at least please point me in the right direction

2 answers

✓ Accepted answer

What you're looking for is a function game.Players:GetCharacterAppearanceAsync(). It takes the userid as an argument and returns a model containing the assets the player is wearing.

2 comments

0

do you know how to take the data and turn it into a model that looks like player?

0

He just told you how, use the function. He even linked the wiki.

If you're trying to edit a player's Character Appearance Manually:

I'm going to suggest looking at DataStores, as you can give each player a unique "key" based on their UserId. https://developer.roblox.com/articles/Saving-Player-Data

You could also save texture ids as string values or the like if you're trying to change the character's appearance (shirts and pants), while accessories will have to be welded to the player manually.

In order to literally view the player's id, you could also just do this:

game.Players.PlayerAdded:Connect(function(player)
	print(player.UserId)
end)

You could then manipulate the UserId property by adding an if-then clause (if not using a DataStore)

game.Players.PlayerAdded:Connect(function(player)
	if player.UserId == 0 then
		local character = workspace:WaitForChild(player.Name)
		character.Humanoid.WalkSpeed = 32
	end
end)

Otherwise, if you want the player's character to match that of another player:

game.Players.PlayerAdded:Connect(function(player)
	game.Players:GetCharacterAppearanceInfoAsync(#)
end)

will give you a table of the player's character parts (the function game.Players:GetCharacterAppearanceAsync(#) will create a new model of the player)

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