In the Atlantis SquarePantis DS game, grab the emerald and use it, which makes gold appear. Collect the gold, then head to Bikini Bottom and go to the cave where the bubble incident happened. Do that, and you'll have freed Mr. Krabs from the treasure room. It can take a bit of trial and error, but it's very satisfying once it clicks.