It all depends on the nature of the person in choosing friends, even though they are in a gambler's family environment, even though each child has a different nature but the role of friends in the social environment can affect a person, even though there is a term (fruit doesn't fall far from the tree) that term sometimes often pinned by people, to be the family of the gambler, the role of friends in life can be good or vice versa so it all depends on how they choose friends in their environment..
Being surrounded by bad influence friends can influence a person even if he or she grew into a good environment in their family. That's really something to be thought about in terms of behavioral process as everyone is learning new things not only from their parents, from the technology but mostly, from the surroundings and neighborhood they live at.
I believe this depends on how strong the core value of the person is. No matter how bad influence his environment if his core value is strong, he can resist this bad influence urging him to do bad things. And it all goes down to how his parents molded him when he is young. At the end it is still goes down to parenting. I have seen people who are surrounded by neighbors with vices but is able to resist those temptation.