I think your talking about request. Like tpa from essentials.
What you need to do is have a request object that holds the player being requested, whether they accepted and the community. After that when they say they want to join you look through all the reqests and match the community and player. From there you have a boolean value of if they accepted.
The better way to do this would be to use the data api because then its saved to the player and the reqests stay even if the server restarts