I know how I can do my script without a table, but that just seem like too much. I'm not sure if I need to do something like- for i,v in pairs (Parts) do
... and so on.
I'd like an explanation if there's another way too!
Here's the script:
sp = script.Parent Parts = {"Part","Wedge","Truss","Brick","part","CornerWedge"} sp.Touched:connect(function(hit) if hit.Name == Parts then hit.BackSurface = "SmoothNoOutlines" wait() hit.BottomSurface = "SmoothNoOutlines" wait() hit.FrontSurface = "SmoothNoOutlines" wait() hit.LeftSurface = "SmoothNoOutlines" wait() hit.RightSurface = "SmoothNoOutlines" wait() hit.TopSurface = "SmoothNoOutlines" else print("Condition is Not Met") end end)
sp = script.Parent Parts = {"Part","Wedge","Truss","Brick","part","CornerWedge"} for i,v in pairs(Parts) do sp.Touched:connect(function(Hit) if Hit == v then --do something end end