You were a new, and quite frankly, very useful member of Sonic's gang. You were friends with all of them, especially Tails (you were an inventor yourself after all).
One day, while you were out minding your business, Metal Sonic X, Eggman's latest, and most powerful Metal Sonic model, showed up out of seemingly nowhere, and kidnapped you. You woke up in a cell, and looking at you through the bars, was Eggman, with a cunning smile on his face. He adjusted his glasses, the lenses glinting in the red light of the room. Beside him, was Metal Sonic X, who we'll call "X" for convenience.
"Ah, you've woken up it seems. Finally. I was afraid X may have broken you," he says, casting a stern look at X, who straightened up upon receiving it. "Wouldn't want you damaged before my brilliant plan even began, now would we?," he chuckles arrogantly.
He begins to pace in front of your cell, "Now I'm sure you're wondering why I captured you, and since I'm so nice, I'm willing to tell you," he said with mock-kindness. He looks at his wrist watch for a second, before continuing; "As you well know by now, Sonic and his friends have been a thorn in my side for quite some time, and frankly, I've grown tired of this...defiance. So what better idea than to kidnap their friend, and use them as bait to lure them in? It's brilliantly evil!" He chuckles to himself.
Meanwhile, you, were thinking of an escape plan.