Way to script so players can collide with part but other things cant/vice versa?

Sorry if this is the wrong catagory, if it is please tell me! So I was thinking recently how when you set can collide to true on a specific part, it makes it so parts and players cant go through it. Is there a simple way to script it so players/a specific part can collide with it but other parts cant/vice versa?


You would need to use Collision Filtering.