How to make a rig/humanoid take the form of a local player who joins the game and only that player will see his or her self on that rig

Hello everyone. I am trying to make a rig/humanoid take the form of a local player who joins the game and only that player will see his or her self on that rig.

The problem is I am unable to affectively do this even though my code makes sense and should work.
Screenshot (465)
Above is an image of the dummy or rig on the left not taking form of the local player or myself on the right.

I could not find any tutorials to effectively help me.

Below is my code I wrote. I inserted a local script in the dummy… (by the way.)

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local desc = Players:GetHumanoidDescriptionFromUserId(LocalPlayer.UserId)

script.Parent.Humanoid:ApplyDescription(desc)


The output does not show anything!D:

If anyone could help I would be so so thankful.
Thank you,
bulder251 :grinning_face_with_smiling_eyes:

1 Like

i wonder if this would work,

in starter player scripts put a local script

local dummy = --path to dummy
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local desc = Players:GetHumanoidDescriptionFromUserId(LocalPlayer.UserId)

dummy.Humanoid:ApplyDescription(desc)

try this and see if it would work

edit:

the reason that your code likely wont work is the fact that it isnt part of the player, so try in the orginal script printing the LocalPlayer variable and see what it says (i think it would say nil)

1 Like

Local scripts only run when they are children of certain objects. If you check out the Local script documentation it will tell you places you can put it.

1 Like

It did not work. :frowning:
I put a local script in starter player and wrote the following’

local dummy = --path to dummy
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local desc = Players:GetHumanoidDescriptionFromUserId(LocalPlayer.UserId)

dummy.Humanoid:ApplyDescription(desc)

It did not work. The dummy did not morph into the local player’s avatar.

1 Like

did you actually put the path to where the dummy is located or did you just leave it as a comment, because if you left the comment i put there and didn’t actually put the path, then it wouldn’t work.

edit heres an example:

1 Like

The problem is that your script is a local script, it has to be a server script, because the local scripts only affect the world of the rig it is inside.

2 Likes

I did…
Did it work for you by any chance?

2 Likes

well, aafter some testing, no. turns out im dumb, :ApplyDescription only works on the server side, an idea ive had though is when the player joins the server makes a clone of the players character, with a remote event sends it to the client and replace the rig with the copy, but sadly I cant get that to work. Im sorry that i cant help.

2 Likes

So… Should I do the exact same script but only using a server script?

2 Likes

I put the same code in the server script and nothing happened. The server script was in the starterplayerscripts.

2 Likes

Put a script in the dummy like this:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local chardesc = char.Humanoid.HumanoidDescription
        script.Parent.Humanoid:ApplyDescription(chardesc)
    end)
end)
6 Likes

This entire concept seems to be changing the rig on the client, but why does the server even care about the rig in the first place? Use the techniques listed above, local script under the player etc, and try loading the description on a cloned model. Place a default rig in ReplicatedStorage and then clone it to where you want in a client-sided local script. Again, don’t put the script under workspace.

@56ytr56, Apply Description works on the client assuming it is a local rig. This would be fixed by cloning the rig on the client side. More info:

(There’s also example code in this thread if you need it, :wink:)
Hope this helps!

P.S. @PatitoCeb, while your code does both work in the workspace and grab the player’s humanoid description when they re-spawn, every player sees this rig. Therefore every player sees a rig which keeps changing to the avatar of the last person to spawn. This is because you change it on the server. Additionally, selecting the local player’s description and making local changes does require a local script in this context.

2 Likes