Here's what happened:
* Obi-Wan kept the lightsaber after the events of Episode III: Revenge of the Sith, where he gave it to Anakin Skywalker before his fall to the dark side.
* Obi-Wan hid the lightsaber in the desert on Tatooine, where Luke would eventually find it with the help of R2-D2.
* R2-D2 was carrying a message from Leia Organa to Obi-Wan, leading Luke to find him and learn about the Force and his destiny.
* Obi-Wan revealed himself to Luke and presented him with the lightsaber, igniting it and revealing its green blade.
While Artoo played a crucial role in connecting Luke with Obi-Wan, the lightsaber was ultimately given to Luke by Obi-Wan himself.