How would I get the local player's appearance to apply to a dummy?

still not quite working but that seems like steps to fixing it
edit: okay the server script isn’t the problem it seems, the problem is the value isn’t updating to contain the userid

1 Like

Are you trying to set the value on the client? The server will not see this value.

1 Like

Well I did that because local scripts can get local player but I’m fairly sure theres ways of getting the local player in regular scripts

1 Like

I see you are calling LocalPlayer on the server. This would error.

game.ReplicatedStorage.GetCharacter.OnServerEvent:Connect(function(player)
	
	local ID = player.UserId

	local function CreateOfflineCharacter(UserID, Dummy)
		local Appearance = Players:GetHumanoidDescriptionFromUserId(UserID)
		Dummy.Humanoid:ApplyDescription(Appearance)
	end
	CreateOfflineCharacter(ID, Dum)
end)

Getting the player through RemoteEvents would work in this case.

3 Likes

I don’t even know what I’m doing wrong at this point I tried this even on a regular dummy with literally no features and it didn’t change him

1 Like

Try putting this as a normal script:

local Players = game:GetService("Players")

local function PlayerAdded(Player)
	
	local function CharacterAdded(Character)
		
		local Humanoid = Character:WaitForChild("Humanoid")
		
		local HumanoidDescription = Humanoid:GetAppliedDescription()
		
		workspace.Dummy.Humanoid:ApplyDescription(HumanoidDescription) 		--Path to dummy humanoid and apply HumanoidDescription
		
		script:Destroy()
	end
	
	Player.CharacterAdded:Connect(CharacterAdded)
end

Players.PlayerAdded:Connect(PlayerAdded)
7 Likes

alright huge progress it actually updates the dummy
only problem being this doesn’t look like me that much
unknown

1 Like

Make sure both the dummy and the player are the same rig type. (R6 and R15)

1 Like

Schermafbeelding 2021-12-19 171331

Working fine here.

1 Like

I checked and they’re both R6, maybe its an R6 problem

1 Like

alright it seems it was an R6 problem

1 Like

You marked my answer as a solution, did you solve it?

local Players = game:GetService("Players")

local function PlayerAdded(Player)

	local function CharacterAdded(Character)

		local Humanoid = Character:WaitForChild("Humanoid")

		local HumanoidDescription = Players:GetHumanoidDescriptionFromUserId(Player.UserId)

		workspace.Dummy.Humanoid:ApplyDescription(HumanoidDescription)

		script:Destroy()
	end

	Player.CharacterAdded:Connect(CharacterAdded)
end

Players.PlayerAdded:Connect(PlayerAdded)

If no, this works.

2 Likes

Im in a situation similar to this, I’m trying to get a decoy to be the character of the local player. Another words, if you see this decoy it will be yourself. The same if you seen this decoy, it’ll be yourself. I was able to officially get the clone, but the issue I ran into is that the decoy isn’t able to be animated for some reason. I’m cloning it from the Replicated Storage. This is the local script that I’m using in Starter Player Scripts.

local player = game.Players.LocalPlayer
local dummy = game:GetService("ReplicatedStorage").DummyPlayerMemory2:Clone()
dummy.Parent = workspace
dummy.Humanoid:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(player.UserId))
local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local hum = script.Parent:WaitForChild("Humanoid")
if hum then
    print("Success")
else
    print("No Humanoid")
end””

Default Roblox animations are controlled by a script called ‘‘Animate’’. That script is in every player’s character. What I think is that your ‘‘Dummy’’ does not contain an animation script.

There is an animate script inside of the dummy. It works when the dummy is in workspace, but not from replicated to the workspace.

If you can tell me if your Dummy is R6 or R15 then I can make a repro and see what goes wrong.

1 Like

We are using R6 here. Thank you

1 Like

It turned out to be due to the fact that you used a LocalScript, I made a model that does work:

Fixed Dummy Appearance Model - Roblox

Take the model and ungroup it’s instances where I indicated it.

1 Like

That works for the animation part. But the catch is I’m trying to have everyone in the game see their own avatar. This way only makes the dummy appearance the first person that joined the server. Such as if you are making a cutscene . Each player would see their own avatar.

That’s where this stops, if you try that you will encounter this error:

Humanoid::ApplyDescription() can only be called by the backend server - Client - LocalScript:11

Code used (LocalScript in StarterPlayerScripts):

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local player = Players.LocalPlayer

if not ReplicatedStorage:FindFirstChild("Dummy") then return end

local dummy = ReplicatedStorage.Dummy
local humanoid = dummy.Humanoid

humanoid:ApplyDescription(Players:GetHumanoidDescriptionFromUserId(player.UserId))

dummy.Parent = workspace

You cannot apply HumanoidDescription on the client.