Different people spawn with different weapons

hi im requesting how to make it so that some people spawn with for instance an ak while randomly others spawn with an m4 sorta like 2 different teams with different weapons

pardon english im spanish