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

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

Asked by 6 years ago
Edited 6 years ago

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

0
To reference a brickColour you need to do (for example) lights.BrickColor = BrickColor.new("Really red") or lights.Material = ("Concrete") Shadi432 69 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

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")
Ad

Answer this question