How to make a team only joinable after being another team?

The title says it. I have 3 teams in my gamemode and I want team 3 to be only accessible after you become team 2. how?

This all depends on how your “join” system is done, the only default “join” code in garrysmod is ply:SetTeam(). Are you by any chance using DarkRP?

No im using ply:SetTeam() but I have figured it out already thank you