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

BrickColor Isnt working after 400 seconds help?

I want to make a part that changes colors heres my script.

part = game.Workspace.Part
wait(400)
part.BrickColor = Color3.new("Really green")

1 answer

✓ Accepted answer

Colors

Colors in ROBLOX are special. Typically, to represent a color value in ROBLOX you'd use the Color3.new constructor which returns a userdata that represents the R, G, B values between 0 and 1 (with a step of 1/255, but you don't have to worry about that for now).

With that said, it should be clear that saying something like Color3.new("String value") is invalid, since it must take the R, G, B arguments (Red, Green, Blue), which must be numbers.

However

BrickColors are different. Instead of them using the Color3.new constructor, they use a constructor called BrickColor.new. This will return the specified BrickColor that you want the part to have. You can even convert Color3 values to BrickColor values, and vise versa. However you should note when doing this, you're limited to the predefined BrickColor table of colors.

Solution

In conclusion, your revised code should look like this:

local part = workspace.Part
part.BrickColor = BrickColor.new("Really green")

You also don't need a wait in between, just make sure your part exists. If you have any questions, just let me know.

3 comments

0

We need to take a moment right here to appreciate and upvote this answer.

0

I'm a firm believer in showing off, but this is crossing the line.

0

Ohhh Okay. Thank you alot :D I'm trying to make a bunch of games to improve my scripting. Thank you!

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