How to make one character able to overlap a mesh but the other one can't?

the bit of script was my attempt at making it work