What you have described in your question is a kind of gambling (lottery), and it is haraam. In fact it is a major sin, according to the Qur’aan, Sunnah and scholarly consensus.
And Allaah is the source of strength. May Allaah bless our Prophet Muhammad and his family and companions, and grant them peace.