Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is the Returned Color Always Black?

Asked by
8391ice 91
8 years ago

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

Log in to vote
1
Answered by
guiraz 25
8 years ago
Edited 8 years ago

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!

0
Thank you very much! 8391ice 91 — 8y
Ad

Answer this question