Server Lock like Bedwars

I need help with a script for my upcoming game. I need to know you you can server lock servers just like popular Bedwars. I’ve searched everywhere and there is nothing on it and only command versions at kicks players (Don’t want). Please help me

You will have to use Private Server for that