Delete this post please
Are you asking for the SQL query or what? Probably something like
SELECT identifier FROM user_keys WHERE key_unit=31
Then check if the identifier is the same as the current user identifier
Well ok, you probably can check if the user is close to a door. Then show a message like
Press ~INPUT_CONTEXT~ to enter this appartment
Then check if the user pressed the button using like controljustpressed
After trigger an even at the server with the room number then let the server send back if the player is allowed to enter
If server sends back like false or no show an notification like “This is not your room!”
Otherwise teleport inside the room (maybe server could send right coordinates or save in the script)