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

Alright yet another question you people probably know off the top of your head with little effort somehow
I’m trying to make it so the monster in a game I’ve made copies the player’s avatar (for the humor I guess)
I’ve tried something like: firing a remote event for all clients (its a 1 player game) that makes a local script get the local player’s user id which then applies it to a string value AND fire server’s the remote event and then a server script reads that value and applies it to the character

heres the local script:

 game.ReplicatedStorage.GetCharacter.OnClientEvent:Connect(function()
  game.ReplicatedStorage.GetCharacter:FireServer()
  workspace.Value.Value = game:GetService("Players").LocalPlayer.UserId
end)

and the server script:

local Players = game:GetService("Players")
local Dum = workspace.NailaWindow
local player = game:GetService("Players").LocalPlayer
local ID = workspace.Value.Value --or remove this and put user id

game.ReplicatedStorage.GetCharacter.OnServerEvent:Connect(function()
	local function CreateOfflineCharacter(UserID, Dummy)
		local Appearance = Players:GetHumanoidDescriptionFromUserId(UserID)
		Dummy.Humanoid:ApplyDescription(Appearance)
	end
	CreateOfflineCharacter(ID, Dum)
end)

I assume it doesn’t work because you can tell I was trying anything at this point and anyone who looks at this “solution” thinks I’m a huge idiot but if anyone has any tips on how I can make this work I’d like to hear them. thanks.
edit: probably also should mention I’m using a solution from another post on the same thing only that post uses a specific user id/name: How to get a player's entire model, not just their assets? - #6 by K_reex

4 Likes

When you change the value in the local script it doesn’t replicate to the server so its just seeing an unchanged value.

When an event is fired the first parameter is always the player that sent it so you can just do

game.ReplicatedStorage.GetCharacter.OnServerEvent:Connect(function(player)
	local function CreateOfflineCharacter(UserID, Dummy)
		local Appearance = Players:GetHumanoidDescriptionFromUserId(UserID)
		Dummy.Humanoid:ApplyDescription(Appearance)
	end
	CreateOfflineCharacter(player.UserId, Dum)
end)
1 Like

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)
5 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