A teenager attacked by a gang on a Leeds street was found to be carrying a loaded gun.