So basically instead of pasting a script with the
function onTouched(hit)
print(script.Parent.Name.. " was touched!")
end
script.Parent.Touched:connect(onTouched)
I was wondering if there was a way to do something like:
Model:GetChildren().Touched:connect(onTouched)
or something of the sort, but it would still work the same rather than having every block in the model reacting, just the block that was touched.

3 comments
So are you wanting an efficient way to add a touched event to multiple parts without repeating code?
Yes
Iterate through the table returned by
:GetChildrenwith afor loopand then connect the event to each returned part. Unless hit detection has to be super accurate, I would suggest just welding a part that just about the size of the model, and listening to the Touched event for that welded part.