By the end of the gutsy trick Anderson pulled, though, Alan was the one who was smiling.
Tap to watch if you're viewing on the news app.
Anderson, a well-known Las Vegas magician who has performed for CEOs, also posts inspiring videos like this one to his YouTube channel.
As the video gained popularity, Anderson wrote a clarification: "For those who are concerned, I stuck around and picked all the money up with him after the camera stopped rolling."
But the feel-good story doesn't end there.
Unbeknownst to Alan, Anderson also set up a GoFundMe page, where more than $20,000 has already been raised to help Alan.
Anderson gave an update on Alan on that page:
"When I spoke with him, he had his usual positive attitude about his situation, and is optimistic about his search for a job now that he has temporary housing provided for him."
The magician plans to surprise Alan with the money and post another video in the next couple of weeks.