I'm a bit of a beginner to scripting and I wanted to make a plugin that changes selected objects from plastic to smoothplastic.
if Obj.Material == "Plastic" and Obj.ClassName == "Part" or Obj.ClassName == "WedgePart" or Obj.ClassName == "CornerWedgePart" or Obj.ClassName == "UnionOperation" or Obj.ClassName == "TrussPart" or Obj.ClassName == "SpawnLocation" then
Obj.Material = "SmoothPlastic"
end
For some reason when i selected a plastic part and activated it the material stayed the same. However when I used a WedgePart it changed to smoothplastic, but it would still change to smooth plastic even when it wasn't plastic. This question probably will make you professional script builders cringe, but i can't figure out how to make this work.

2 comments
The issue is most likely to due with the order of the if statement. Is stating if the object is Plastic and the has the class name equal to part or if it is a wedge part. Hard to explain but when putting or statements it is best to use parenthesis. But anyway this could all be avoided if you instead use :IsA("BasePart") .
thanks