Scientists describe a gene in Nicotiana attenuata which enables the plant to solve the dilemma that arises when a pollinator is also an herbivore. NaTPS38 regulates the production of (E)-alpha-bergamotene. At night, the tobacco flowers produce this volatile which is attractive to tobacco hawkmoths, during the day, the tobacco leaves emit the compound to lure predatory bugs to feed on the moths’ larvae.