Skin cancer, like most cancers, is a complex formation between genetics and environmental exposures.
Most people who have a family member with skin cancer are at increased risks for getting skin cancer in the future. However, this is not 100 percent. For example, people with blue eyes are seven times more likely to get skin cancer compared to people with brown eyes. And it's most likely that you got your blue eyes either from your mother or father. But just because your father with blue eyes has skin cancer does not mean you will get skin cancer in the future.
Talking to your dermatologist, and figuring out all your risk factors can give you a better idea of what kind of preventive measures you need to take to avoid getting skin cancer in the future.