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

Problem with BrickColor.new() returning a different color than expected?

so whenever i use BrickColor.new() it returns a different color than expected sometimes, why? here is part of a script:

script.Parent.BrickColor = BrickColor.new(255, 0, 0) -- turns the color red
wait(2)
script.Parent.BrickColor = BrickColor.new(31, 128, 29) -- turns it to forest green

when it changes it to the green, it makes it white ._.

1 comment

1

Use Color3.fromRGB

1 answer

Brick color expects argument 1 as a string. Instead use Color3.fromRGB

script.Parent.Color = Color3.fromRGB(255, 0, 0)
wait(2)
script.Parent.Color = Color3.fromRGB(31, 128, 29)

3 comments

0

Thanks!!!

0

BrickColor accepts numbers aswell and it's not the issue. You simply can't set a color of a part to one not defined in brickcolors. If you use the Color property or number arguments of BrickColor.new, it will just set to the closest BrickColor.

0

well yeah but im not gonna explain that in depth

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