clingy cat!!

so i had just moved my cats litter box from my bedroom to the living room because my rooms too small and he always stinks it up when he uses it. but he loves sleeping with me and it’s hard because i can’t have him sleeping with me without leaving my door open. but i cant leave my door open bc i live with roommates and i dont want them to see when im u know... sleeping. idk whatto do!!! at night he scratches at my door bc he wants to be let in but im scared if i close the door he’ll go potty on the floor or something:( what should i do?