How do I make it so players can choose classes

i am trying to make a tf2 like game, but I can’t seem to make it so that players can choose their classes (like one classes would have 3 weapons and then another class would have difrent weapons).

The way i approached it was by using dialogues.
one shows all the different classes and the other ones explained the class brief and let you choose it or return to the first dialogue.

A common way is also to use AI units on the team base and when the player interact with these units, they change to that class.