How do I make a script that only a certain rank can join the game and if a player doesn't have that rank it kicks them out?
Have a server script that listens for the PlayerAdded event, then for every player that joins, check their rank in the group you're looking for using the GetRankInGroup method on the player. Check if that rank meets your needs, and if not, then kick the player using the Kick method on the player, optionally providing a reason for the kick.
Hope this helps! :)