I basically decided to make a 5x5 floor where each part would change brick color when a player walked on it. I was able to sort of make this happen... but as soon as I tested it I realized that the tiles also recognized the baseplate and each other as a "touch". So the end result was a bunch of tiles constantly changing back and forth between colors in an ugly mess. Is there way to write it so that it only fires when a player touches the part and not other things? Here's what it looked like, I basically just had 25 versions of this with the "partX" name changed in it each time:
game.Workspace.part1.Touched:Connect(function(hit)
game.Workspace.part1.BrickColor = BrickColor.new("Electric blue")
end)
game.Workspace.part1.TouchEnded:Connect(function(miss)
game.Workspace.part1.BrickColor = BrickColor.new("Institutional white")
end)
There's probably a much more efficient way to accomplish this, but this is literally my third day scripting and I just got through all of AlvinBlox's YouTube tutorials. Hopefully there's a not too complicated way of doing this.
Thanks

2 comments
FYI, that won't help much at all in the way of efficiency, but it will make it more clean and reduce the amount of hard-coding he has.
I do agree, also I refer to efficient as doing much less work on his part, which saves time, definitely making it much more efficient.