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

How to change my baseplate color using a script?

Asked by 5 years ago

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?

0
Define what you mean by "custom color". Do you want to make your own color based off of RGB values or do you want to use a color in roblox like "Teal Blue"? laggydude 0 — 5y
0
A roblox color, I already know how to use RGB. superyadi 0 — 5y

2 answers

Log in to vote
3
Answered by
MuN8MuN 47
5 years ago
Edited 5 years ago

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

0
very nice explanation :) Le_Teapots 913 — 5y
0
Yes, this is a great explanation, one mistake though, fromHSV wants values from 0-1 rather than say 120 or 100 theking48989987 2147 — 5y
0
'theking' .. numbers, thanks, I kinda went on a risk there since I never use HSV neither in roblox, nor anywhere, so I have assumed that MuN8MuN 47 — 5y
Ad
Log in to vote
-1
Answered by
IcyMizu 122
5 years ago
Edited 5 years ago
game.baseplate.BrickColor = BrickColor.new("Green")

u set a new brickcolor this way

Answer this question