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 player's character's model?

I am trying to make a winning cutscene so when a player wins a round, the game will load their character, make them dance and have a cutscene saying "Player's name won the game!!!!!"

I've tried using

:GetCharacterAppearanceAsync()

although this doesn't seem to work directly, it loads in all my accesories and my body parts but everything is grey, everything is in the wrong place and I doubt all my body parts are even all there.

How can I actually load a character's model that looks like it is in - game

I'm sure there's an easy function for this, I just can't find it.

Thanks

IMPORTANT

I also want to do this at run time

3 comments

0

oop

0

i got complex code : local get = workspace:GetChildren() for i,c in pairs(get) do print(c.Name, c.Parent, c.ClassName) local gett = c:GetChildren() for i,x in pairs(gett) do print(x.Parent, x.Name x.ClassName) local gettt = x:GetChildren() for i,a in pairs(gettt) do print(a.Parent, a.Name a.ClassName) end end end script above prints workspaces children and its children 3 times and prints

1 answer

✓ Accepted answer

You can do this with Players:GetHumanoidDescriptionFromUserId and Humanoid:ApplyDescription

The first will get the HumanoidDescription of the player. A HumanoidDescription instance contains everything about a player's appearance: packages, accessories, faces, etc.

Then, you can use the second function on a dummy rig using Humanoid:ApplyDescription() with the HumanoidDescription you just got from the player. For example:

local Players = game:GetService("Players")

--Put a dummy or template rig in ServerStorage
local rig = game:GetService("ServerStorage"):WaitForChild("Dummy"):Clone()

--This is my userid, you should replace it with the winner in your version
local testId = 56389

--Get player appearance
local HumanoidDescription = Players:GetHumanoidDescriptionFromUserId(testId)

--Apply appearance to dummy rig
rig.Humanoid:ApplyDescription(HumanoidDescription)
rig.Parent = workspace

--The rig should now look like the appearance of the player. You can animate it, position it, etc.

1 comment

0

Thank you sooo much, I had to do a little bit of debugging to get your script to work, but it worked perfectly in the end. Thanks soooooooo much

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