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

(?) Please help me with this basic script would really help, have a good day :)

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.

2 comments

0

Watch the language! Profanity is not permitted on this site.

0

Why do u need to change "kinda shit" to "kinda poor" like why do u care about the word "shit", second of all why are u even editing a 2 months old question.... xd

1 answer

✓ Accepted answer

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

1 comment

0

ty

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