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