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

How to load a player's character's model?

Asked by 3 years ago

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

0
oop Sparks 534 — 3y
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 3F1VE 257 — 3y

1 answer

Log in to vote
0
Answered by
Sparks 534 Moderation Voter
3 years ago

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.
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 UltimateGameDudez 19 — 3y
Ad

Answer this question