Skin Colour Checker/Changer not working

local allowed = {
	BrickColor.new("Reddish brown"),
	BrickColor.new("Dirt brown"),
	BrickColor.new("Dark taupe"),
	BrickColor.new("Brown"),
	BrickColor.new("Linen"),
	BrickColor.new("Nougat"),
	BrickColor.new("Light orange"),
}

local NewColor = BrickColor.new("Light orange")

function changeColors(character)
	character["Body Colors"].HeadColor = NewColor
	character["Body Colors"].RightArmColor = NewColor
	character["Body Colors"].RightLegColor = NewColor
	character["Body Colors"].LeftArmColor = NewColor
	character["Body Colors"].LeftLegColor = NewColor
	character["Body Colors"].TorsoColor = NewColor
	print("skin changed")
end

	
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		
		for i,v in pairs(allowed) do
			if not character.Head.BrickColor == v then
				changeColors(character)
			elseif not character["Right Arm"].BrickColor == v then
				changeColors(character)
			elseif not character["Right Leg"].BrickColor == v then 
				changeColors(character)
			elseif not character["Left Arm"].BrickColor == v  then
				changeColors(character)
			elseif not character["Left Leg"].BrickColor == v  then
				changeColors(character)
			elseif not character.Torso.BrickColor == v  then
				changeColors(character)
			else
				print("player has natural skin color")
			end
		end	
	end)
end)

I’m trying to make a script that checks the skin colour of a player and if it’s not realistic then it will change it to a realistic one, however its not working. The output is printing “player has natural skin” even though they don’t. Can anyone help?

What is the variable c? shouldn’t it be v?

for i,v in pairs(allowed) do
            if not character.Head.BrickColor == v then

Sorry I changed it from x,c to i,v because that’s the way people usually do it and forgot to update. The script doesn’t work still thought.

Well, the script right now feels very congested and there’s too much to keep track of, so I would suggest doing a for loop checking to see if there are any Parts (What the player character is made up of) and if there is, then to color them the color you want.

Example:

local allowed = {
	BrickColor.new("Reddish brown"),
	BrickColor.new("Dirt brown"),
	BrickColor.new("Dark taupe"),
	BrickColor.new("Brown"),
	BrickColor.new("Linen"),
	BrickColor.new("Nougat"),
	BrickColor.new("Light orange"),
}

local NewColor = BrickColor.new("Light orange")

function changeColors(character)

	for h, a in pairs(character:GetChildren()) do		
		if a:IsA("Part") then
			a.BrickColor = NewColor
				
			print("skin changed")
		end
	end
	
end


game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)

		wait(2)

		for i, v in pairs(allowed) do
			for h, a in pairs(character:GetChildren()) do		
				if a:IsA("Part") then
					if a.BrickColor ~= v then
						print(a.Name)

						changeColors(character)
					else
						print("player has natural skin color")
					end
				end
			end
		end

	end)
end)