This is apparently from the Mormon movie: The Life of Jesus Christ, but it’s exactly what Jesus said in Matthew 19:
16 Behold, one came to him and said, “Good teacher, what good thing shall I do, that I may have eternal life?” 17He said to him, “Why do you call me good? No one is good but one, that is, God. But if you want to enter into life, keep the commandments.” 18 He said to him, “Which ones?” Jesus said, “‘You shall not murder.’ ‘You shall not commit adultery.’ ‘You shall not steal.’ ‘You shall not offer false testimony.’ 19 ‘Honor your father and mother.’ And, ‘You shall love your neighbor as yourself.'” 20 The young man said to him, “All these things I have observed from my youth. What do I still lack?” 21 Jesus said to him, “If you want to be perfect, go, sell what you have, and give to the poor, and you will have treasure in heaven; and come, follow me.” 22 But when the young man heard the saying, he went away sad, for he was one who had great possessions.
Jesus and The Young Rich Man