Certified GKH Gardening Expert
If you are in an area where there are very few natural insects that pollinate these plants, then they will not produce. I like to grow melons in my indoor tent with LED, and to do this I must hand pollinate the female flowers with the males. You can tell the difference easily. There are more male flowers, and the females have a small fruit growing on the bottom of them. Just take a paintbrush, or q-tip and get pollen from the males, and transfer to the female.
Here is an article for more information: https://www.gardeningknowhow.com/edible/fruits/melons/hand-pollinating-melons.htm