Answered by
6 years ago Edited 6 years ago
Logic operations in programming
Unlike in everyday, where common sense acts as a filler for some shortfalls, no such thing exists in programming. With that said, the problem here is line 3 for you,
1 | if plaan [ i ] .ClassName = = "MeshPart" or "Part" then |
it is generally implied in everyday english that the meaning of it is:
1 | if plaan [ i ] .ClassName = = "MeshPart" or plaan [ i ] .ClassName = = "Part" then |
but, no implications like that occur with the complier, which is exceptionally picky,instead of that is checks if plaan[i].ClassName == "MeshPart" is a truthy value(not false or nil) and checks if "Part" is a truthy value, instead of checking if plaan[i].ClassName is part.
Hopefully this helped solve your problem