How to make a startercharacters bodycolors players torso color

title says it all, I want to make the StarterCharacter (forced character) to have the skintone of the players roblox avatar’s torso, similar to pfs (Pillow fight simulator)

I’ve tried getting the players startercharacter then their character from their userid and trying to make every single value in the bodycolors of the startercharacter match that of the player torso but it didn’t work

Targeted look: [PLANE SURVIVAL] 🌟 Pillow Fight Simulator 🌟 - Roblox

thanks :slight_smile:

so i found a solution, if anyone else would like the way i did it here is my code: local players = ```

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(charatcer)
		charatcer["Body Colors"].HeadColor = BrickColor.new(players:GetCharacterAppearanceInfoAsync(player.UserId).bodyColors.torsoColorId)
		charatcer["Body Colors"].LeftArmColor = BrickColor.new(players:GetCharacterAppearanceInfoAsync(player.UserId).bodyColors.torsoColorId)
		charatcer["Body Colors"].RightArmColor = BrickColor.new(players:GetCharacterAppearanceInfoAsync(player.UserId).bodyColors.torsoColorId)
		charatcer["Body Colors"].RightLegColor = BrickColor.new(players:GetCharacterAppearanceInfoAsync(player.UserId).bodyColors.torsoColorId)
		charatcer["Body Colors"].TorsoColor = BrickColor.new(players:GetCharacterAppearanceInfoAsync(player.UserId).bodyColors.torsoColorId)
		charatcer["Body Colors"].LeftLegColor = BrickColor.new(players:GetCharacterAppearanceInfoAsync(player.UserId).bodyColors.torsoColorId)
	end)
end)

--note that this MY way and may not be the most performance efficient nor be best code to ever be
1 Like

Sup, can you format it with the script widget? It is a bit hard to read as of right now, and I think other people would benefit if it was formatted with the script widget.

```
You copy and plaste those 3 characters to make a script widget. So something like this:

```
local var = true;
```

local var = true;
1 Like
local Enumeration = Enum
local Game = game
local Players = Game:GetService("Players")

local function OnPlayerAdded(Player)
	local function OnCharacterAdded(Character)
		local Success, Result = pcall(function() return Players:GetCharacterAppearanceInfoAsync(Player.UserId) end)
		if not Success then warn(Result) return end
		local Color = Result.bodyColors.torsoColorId
		local BodyColors = Character:FindFirstChildOfClass("BodyColors") or Character:WaitForChild("Body Colors")
		for _, BodyPart in ipairs(Enumeration.BodyPart:GetEnumItems()) do
			BodyColors[BodyPart.Name.."Color"] = Color
		end
	end
	
	Player.CharacterAdded:Connect(OnCharacterAdded)
end

Players.PlayerAdded:Connect(OnPlayerAdded)
1 Like

after tweaking the code a bit this works a lot better than my initial code, thanks! :slight_smile: