g = game.Workspace.Part if g.Material == ("Plastic") then g.BrickColor.new = ("Bright red") end
-- using "Plastic" doesnt work
-- "Bright red" doesnt work either / tried Brickcolor3 aswell.
-- I really want to know what Im doing wrong, kinda poor at scripting. thought this would be really easy.
Material
requires an enum, so you have to do:
if g.Material == Enum.Material.Plastic then end
Or you can do:
if g.Material.Name == "Plastic" then end
The property to change a part's colour is BrickColor, which requires a BrickColor object.
g.BrickColor = BrickColor.new("Bright red")