Complex sentence: Rayna was an android created by the immortal Flint to be his companion, but when Captain Kirk and Mr. Spock visited their planet, she fell in love with Kirk.
Split into simpler sentences: Rayna was an android created by the immortal Flint to be his companion. When Captain Kirk and Mr. Spock visited their planet, however, she fell in love with Kirk.