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

What do you call the Material and Brick color in a script?

I used to be a good scripter until 2013. Things got advanced and I lost some of my scripting knowledge. I'm making a light switch and I don't know how to call the Material and Color3 of the brick. Help? The script currently is

light = true
local lights = script.Parent.Parent.Model:GetChildren()
function onClicked()
if light == true then
lights.

end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Thanks

1 comment

0

To reference a brickColour you need to do (for example) lights.BrickColor = BrickColor.new("Really red") or lights.Material = ("Concrete")

1 answer

It would simply be:

lights.Material

or

lights.BrickColor

The material has to be a material enum data type and the BrickColor has to be a BrickColor value.

Example:

lights.Material = Enum.Material.Neon

or

lights.Material = "Neon"

For the BrickColor, the new color must be set as a BrickColor value like so:

lights.BrickColor = BrickColor.new("Really red")

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