I still remember and believe that the fruit that falls will not be far from the tree, as well as the activities of a father who gambles even though it is not known to his child but basically he has inherited that trait in the mind of a child. There is always a cause and effect of someone's actions in the past that will apply to their child in the future. But we must remain optimistic and change the system of how we educate our children and hope that our efforts to keep our children away are truly successful. There is always hope behind uncertainty.
This is not always the case, although children often copy their parents. If a father can show by his own example that his experience in gambling was bad, that he lost much more than he won, then this can help the child make the right decision, if he sees that his child is disappointed with gambling, that he has spent a lot of time and a lot of money, then perhaps it is the father's example that will be the reason why the son will never start playing.
Besides the family, friends can also have big influence in getting gambling habits. If his friends gamble, person can feel pressure to start gambling in order to get along with his friends. This is specially highlighted in teenage and early 20s when friends have most influence on person.
On the other hand if his friends avoid gambling, then he will probably avoid it too.