Group Rank Team Changer

Hi, I’m new to scripting and would like to make it so when you click on a Button, if you’re in the right Group rank(as well as in the group obviously), it teams you the team on clicked. If you’re not in the Group/at the correct rank, you WILL not go on the team.

First what I’m pretty sure about is that I need to create a RemoteEvent for when you get teamed. And make a script in workspace so it knows to team you when the button is clicked, and last but, not least a script inside of the button to fire the RemoteEvent if you’re in the group and at the correct rank.

^ Tell me if this is right, if it’s not please explain to me and help. Thanks!

You’ll need to fire a remote event when you click the button, and receive the signal in ServerScriptService. Then you can use :GetRankInGroup(2) or :GetRoleInGroup(2) to find out what rank they are, and if you should change their team.