Unable to change the StarterCharacter's limb colors

Simply put, i want my StarterCharacter to have the player’s default avatar colors, but it won’t work… It just appears as the default gray character (check picture below)

image

The script (located in ServerScriptService):

local Players = game:GetService("Players")

local function onPlayerAdded(player)
	local avatarDescription = Players:GetHumanoidDescriptionFromUserId(player.UserId)

	player.CharacterAdded:Connect(function(character)
		for _, part in pairs(character:GetChildren()) do
			if part:IsA("UnionOperation") or part:IsA("Part") then
				if part.Name ~= "HumanoidRootPart" then
					local colorPropertyName = part.Name .. "Color"
					if avatarDescription[colorPropertyName] then
						part.BrickColor = BrickColor.new(avatarDescription[colorPropertyName])
					end
				end
			end
		end
	end)
end

Players.PlayerAdded:Connect(onPlayerAdded)

image

Yes, the Unions have UsePartColor set to true.

you should try adding spaces in the limb names because thats how roblox does it.
example - LeftArm > Left Arm

Did that. Remains unchanged, and as a bonus, animations broke.

local Players = game:GetService("Players")

local function onPlayerAdded(player)
	local avatarDescription = Players:GetHumanoidDescriptionFromUserId(player.UserId)

	player.CharacterAdded:Connect(function(character)
		for _, part in pairs(character:GetDescendants()) do
			if part:IsA("UnionOperation") or part:IsA("Part") then
				if not (
					part.Name == "HumanoidRootPart" or
						part.Name == "OpenEyes" or
						part.Name == "ClosedEyes"
					) then
					local colorPropertyName = part.Name .. "Color"
					if colorPropertyName ~= "HumanoidRootPartColor" then
						part.BrickColor = BrickColor.new(avatarDescription[colorPropertyName])
					end
				end
			end
		end
	end)
end

Players.PlayerAdded:Connect(onPlayerAdded)

Got it fixed.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.