I've tried creating the script, but because I no idea where to start on it, I'm stuck. I've been trying to make this script for 2 weeks. I'd also appreciate it if you could also explain it to me. thanks
Well First Of All...
I am not going to make the script for you, as the scripter themselves should have knowledge of this.
Resources
There countless wiki.roblox topics regarding your question, all I could do is point you into the right direction. Here are some resources you can use that are related to your topic.
Resource 1
http://wiki.roblox.com/index.php?title=Matchmaking
Resource 2
http://wiki.roblox.com/index.php?title=Custom_teleport_ui
So...
I know your gonna be mad when you see this answer, as you want someone to do the work for you, but if you learn this, you'll be able to be proud of your accomplishment as a scripter. Try using your knowledge gathered from these resources, and good luck.
GreekGodOfMLG