Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help with body colors?

So, this script works but not how I want it to. I want it to change the players Colors by changing it to the value of a variable. But it only changes when the player spawns. I need it to change when the player clicks a button. But I already made it so that when the player clicks a button it changes the Value of Skin Color. So I need the value of Skin Color to be the value of the body. (If that made sense)?


skin = game.Workspace.SkinColor.Value game.Players.PlayerAdded:connect(function(player) player.CanLoadCharacterAppearance = false player.CharacterAdded:connect(function(Character)

Character.Head.BrickColor = skin Character["Left Arm"].BrickColor = skin Character["Right Arm"].BrickColor = skin Character["Right Leg"].BrickColor = skin Character["Left Leg"].BrickColor = skin Character["Torso"].BrickColor = skin

end)

end)


2 comments

0

Changed my answer, sorry I thought the skin was a BodyColor object.

0

Error? Any error?

1 answer

✓ Accepted answer

Use a generic for loop to get the parts and change the brick color to the skin's value. It's called SkinColor not Value, that was your mistake.


#Final Product

skin = workspace.Skin
game.Players.PlayerAdded:connect(function(player)
    player.CanLoadCharacterAppearance = false
    player.CharacterAdded:connect(function(Character)
	for _,p in pairs(Character:GetChildren()) do
		if p:IsA("BasePart") then
			p.BrickColor = skin.SkinColor
		end
	end
    end)
end)


Hope it helps!

1 comment

0

It doesnt work ;( I need it to loop

This discussion is preserved as it was. New answers, comments, and votes are closed.