Dummy with player's description

local dummy = script.Parent

dummy:FindFirstChild("HumanoidRootPart").Touched:Connect(function(hit)
	local Players = game:GetService("Players")
	local userId = Players:GetUserIdFromNameAsync(hit.Parent.Name)
	
	dummy.Humanoid:ApplyDescription(Players:GetHumanoidDescriptionFromUserId(userId))
end)

I need 2 things.
1 - How to check does dummy already have other player’s appearance on
2 - Why is ApplyDescription function making dummy shrink (it is shorter than normal player)

I still need help with this

Bb

  1. To check if the dummy already has another player’s appearance, you can create a variable to store the current UserId of the appearance applied to the dummy. Initialize it to nil and update it whenever you apply a new appearance. Then, you can check if this variable is not nil before applying the new appearance.

Here’s the modified script with the added check:

local dummy = script.Parent
local currentPlayerUserId = nil

dummy:FindFirstChild("HumanoidRootPart").Touched:Connect(function(hit)
    local Players = game:GetService("Players")
    local userId = Players:GetUserIdFromNameAsync(hit.Parent.Name)
    
    if currentPlayerUserId ~= userId then
        currentPlayerUserId = userId
        dummy.Humanoid:ApplyDescription(Players:GetHumanoidDescriptionFromUserId(userId))
    end
end)
  1. The ApplyDescription function may make the dummy shrink because the player’s appearance includes the body proportions, which might be different from the dummy’s original proportions. To prevent the dummy from shrinking, you can either:
  • Remove the BodyProportionScale property from the humanoid description before applying it to the dummy.
  • Set the BodyHeightScale and BodyWidthScale properties to match the desired height and width of the dummy.

Here’s an example of how to remove the BodyProportionScale before applying the humanoid description:

local dummy = script.Parent
local currentPlayerUserId = nil

dummy:FindFirstChild("HumanoidRootPart").Touched:Connect(function(hit)
    local Players = game:GetService("Players")
    local userId = Players:GetUserIdFromNameAsync(hit.Parent.Name)
    
    if currentPlayerUserId ~= userId then
        currentPlayerUserId = userId
        local humanoidDescription = Players:GetHumanoidDescriptionFromUserId(userId)
        humanoidDescription.BodyProportionScale = 0
        dummy.Humanoid:ApplyDescription(humanoidDescription)
    end
end)

Alternatively, you can set the BodyHeightScale and BodyWidthScale properties to match the desired height and width of the dummy:

local dummy = script.Parent
local currentPlayerUserId = nil
local desiredHeightScale = 1
local desiredWidthScale = 1

dummy:FindFirstChild("HumanoidRootPart").Touched:Connect(function(hit)
    local Players = game:GetService("Players")
    local userId = Players:GetUserIdFromNameAsync(hit.Parent.Name)
    
    if currentPlayerUserId ~= userId then
        currentPlayerUserId = userId
        local humanoidDescription = Players:GetHumanoidDescriptionFromUserId(userId)
        humanoidDescription.BodyHeightScale = desiredHeightScale
        humanoidDescription.BodyWidthScale = desiredWidthScale
        dummy.Humanoid:ApplyDescription(humanoidDescription)
    end
end)

Choose one of these solutions to prevent the dummy from shrinking when applying a player’s appearance.

What about removing description from dummy?

Yeah and about it, “BodyProportionScale is not a valid member of HumanoidDescription “HumanoidDescription””. Both codes give me this error

I still need help with those errors, I dont know why they happen