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

Why is the Returned Color Always Black?

This script is the child of a Frame. The script is supposed to match the background color of the Frame to the Player's torso. But when I run this script, the color always returns black, even if the torso's color is red, white, green, or any other color. How can I fix this?

while true do
	wait()
	script.Parent.BackgroundColor3 = Color3.new(script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Character["Body Colors"].TorsoColor)
end

1 answer

It returns black and probably returns na error aswell because you're trying to set a BrickColor value to a Color3 value, try this:

script.Parent.BackgroundColor3 = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Character["Body Colors"].TorsoColor.Color --added the ".Color" to transform the BrickColor into a Color3 value, there's no need for the Color3.new() here

You don't need the loop, you only have to set the value once. Hope I helped! Good luck!

1 comment

0

Thank you very much!

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