Just started scripting 15 minutes ago
When using the output its reaaallly simple. workspace.Baseplate.BrickColor.new("Green")
Notice how I used "new" because I want to use a custom color, not the preset ones.
I've tried using the same set above in a script but it didnt work, the output and scripts are different. In the script I did game.workspace.Baseplate.Brickcolor.new("Green") and it didnt even work. Why, and how can I fix it?
Hi :D
Your solution is not working first since there's no such BrickColor as "Green". When you use BasePart.Brickcolor.new(string BrickColorName)
, you create a brick color by its name. A full list of brick colors and their names can be found here: developer.roblox.com article.
In your case, you might use workspace.Baseplate.BrickColor.new(color)
with color as "Dark green"
, "Medium green"
, "Bright green"
or "Lime green"
.
Also, to set a property, you have to reference it and set it to some value using = . What you did in your try is you referenced the BrickColor property of a part and tried to use the new()
function on it, which didn't work, because the BrickColor property does not have that function. If you want to set the property to something, you need a BrickColor value. The BrickColor property and BrickColor data type are different things, and the latter can use new()
to create a new value.
Example:
workspace.Baseplate.BrickColor = BrickColor.new("Medium green")
workspace.Baseplate.BrickColor = BrickColor.new("Lime green")
You can also modify the Color property instead of BrickColor, which allows you to chose any color. The simplest ways are to make a Color3 from RGB (using the fromRGB(number red, number green, number blue)
function) or from HSV (using the fromHSV(number hue, number saturation, number value)
function) with 3 numbers. Here are some examples:
workspace.Baseplate.Color = Color3.fromRGB(0, 255, 0)
workspace.Baseplate.Color = Color3.fromHSV(120, 100, 100)
Hope this helps, Have a super-duper-day! :D
game.baseplate.BrickColor = BrickColor.new("Green")
u set a new brickcolor this way