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

The brick is NOT turning colors...?

I'm having a ton of trouble on this but I'm ALMOST there!! The brick isn't turning colors, and after looking at the Wiki for a while, I can't find anything!

bag = script.parent.parent.parent

function onClick()
    bag.brickColor = Color3.new(25,25,255)
end

script.Parent.MouseButton1Click:connect(onClick)

Bag is a Handle, a suitcase, and it is supposed to change colors when you click a color on this GUI!

1 answer

Almost everything in this script is wrong.

Read the output and it will tell you that things are amiss.

Names are case sensitive.

You must use .Parent instead of .parent. You must use .BrickColor instead of .brickColor.

Colors

A Color3 is not a BrickColor. BrickColors are constructed by their names. E.g.,

bag.BrickColor = BrickColor.new("Bright blue")

Color3.new takes parameters between 0 and 1, not 0 and 255. You must scale them down. Thus Color3.new(0.1, 0.1, 1) is approximately the color you're asking for. You can convert a Color3 value into a BrickColor using the BrickColor constructor:

bag.BrickColor = BrickColor.new( Color3.new(0.1, 0.1, 1) )

2 comments

0

The output is like this: 14:56:36.207 - BrickColor is not a valid member of ScreenGui 14:56:36.207 - Script 'Players.Player.PlayerGui.Magazine.Frame.Blue.Color script', Line 4 14:56:36.208 - Stack End

0

The error tells you what's wrong. bag right now is a ScreenGui, not a part. So it doesn't have a "BrickColor" property.

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