A well-known hymn of the Rigveda narrates how gambling with dice (die) causes ruin to a person's life:
Rigveda - Book 10, Hymn 34
1 Sprung from tall trees on windy heights, these rollers transport me as they turn upon the table. Dearer to me the die that never slumbers than the deep draught of Mujavan's own Soma.
2 She never vexed me nor was angry with me, but to my friends and me was ever gracious. For the die's sake, whose single point is final, mine own devoted wife I alienated.
3 My wife holds me aloof, her mother hates me: the wretched man finds none to give him comfort. As of a costly horse grown old and feeble, I find not any profit of the gamester.
4 Others caress the wife of him whose riches the die hath coveted, that rapid courser: Of him speak father, mother, brothers saying, We know him not: bind him and take him with you.
5 When I resolve to play with these no longer, my friends depart from me and leave me lonely. When the brown dice, thrown on the board, have rattled, like a fond girl I seek the place of meeting.
6 The gamester seeks the gambling-house, and wonders, his body all afire, Shall I be lucky? Still do the dice extend his eager longing, staking his gains against his adversary.
7 Dice, verily, are armed with goads and driving-hooks, deceiving and tormenting, causing grievous woe. They give frail gifts and then destroy the man who wins, thickly anointed with the player's fairest good.
8 Merrily sports their troop, the three-and-fifty, like Savitar the God whose ways are faithful. They bend not even to the mighty's anger: the King himself pays homage and reveres them.
9 Downward they roll, and then spring quickly upward, and, handless, force the man with hands to serve them. Cast on the board, like lumps of magic charcoal, though cold themselves they burn the heart to ashes.
10 The gambler's wife is left forlorn and wretched: the mother mourns the son who wanders homeless. In constant fear, in debt, and seeking riches, he goes by night unto the home of others.
11 Sad is the gambler when he sees a matron, another's wife, and his well-ordered dwelling. He yokes the brown steeds in the early morning, and when the fire is cold sinks down an outcast.
12 To the great captain of your mighty army, who hath become the host's imperial leader, To him I show my ten extended fingers: I speak the truth. No wealth am I withholding.
13 Play not with dice: no, cultivate thy corn-land. Enjoy the gain, and deem that wealth sufficient. There are thy cattle, there thy wife, O gambler. So this good Savitar himself hath told me.
14 Make me your friend: show us some little mercy. Assail us not with your terrific fierceness. Appeased be your malignity and anger, and let the brown dice snare some other captive.
According to the above, the consequences for the gambler are:
Consequently, the wise advice is given to "Play not with dice: no, cultivate thy corn-land. Enjoy the gain, and deem that wealth sufficient". And, this was divine advice - "Savitar himself hath told me".
Likewise, in perhaps the most influential Dharmashastra, the Manusmriti, gambling of all sorts is prohibited, and condemned as a vice:
Manusmriti - Chapter 7
45 (A king) shall shun the ten ruinous vices springing from love of pleasure, as also the eight arising from anger.
46 The king who is addicted to vices springing from the love of pleasure becomes deprived of wealth and virtue; while he who is addicted to those proceeding from anger becomes bereft of his very soul.
47 Hunting, dice, sleeping during the day, censoriousness, women, intoxication, musical triad and listless wandering constitute the ten-fold set arising from the love of pleasure.
Manusmriti - Chapter 9
220 Thus has been expounded to you Partition, and the appointing of the 'soil-born' and other kinds of sons in due order. Now learn the law relating to Gambling.
221 The King shall exclude from his realm Gambling and Betting; these two evils bring about the destruction of the kingdoms of princes.
222 Gambling and Betting are open theft; the King shall always be careful in suppressing them.
223 That which is done through inanimate things is called 'Gambling'; while what is done through animate things is to be known as 'Betting.'
224 He who either does the gambling or betting himself, or helps others to do them - all these the King shall strike; as also those Śūdras who assume the guise of twice-born men.
225 Gamblers, dancers, cruel men, men belonging to heretical sects, men addicted to evil deeds, dealers in wine - these the King shall instantly banish from his town.
226 These disguised thieves, living in the King's realm, constantly harass the well-behaved people by their evil deeds.
227 In former cycles gambling has been seen to be the great source of enmity; the wise man shall therefore not have recourse to gambling, even for fun.
228 If a man has recourse, either openly or secretly, to this (vice), the form of punishment inflicted upon him shall be in accordance with the King's discretion.
The above are very clear, straightforward condemnations of gambling, which really do not require additional commentary.
However, Hinduism is not consistent with this prohibition and condemnation of gambling. Rather, in the Atharvaveda, one can find multiple hymns which entreat the Hindu gods for help in winning while gambling.
For example:
Atharvaveda - Book 4, Hymn 38
1 Hither I call the Apsaras, victorious, who plays with skill, Her who comes freely forth to view, who wins the stakes in games of dice.
2 Hither I call that Apsaras who scatters and who gathers up. The Apsaras who plays with skill and takes her winnings in the game.
3 Dancing around us with the dice, winning the wager by her play. May she obtain the stake for us and gain the victory with skill. May she approach us full of strength: let them not win this wealth of ours.
4 Hither I call that Apsaras, the joyous, the delightful one - Those nymphs who revel in the dice, who suffer grief and yield to wrath.
Above is entreating Apsaras - essentially female angels or fairies - to help them win at dice, in opposition to their enemies - "let them not win this wealth of ours".
Likewise, in Book 7, there is a prayer to Agni, one of the principle Vedic deities, for good fortune in gambling:
Atharvaveda - Book 7, Hymn 50
1 As evermore the lightning flash strikes, irresistible, the tree, so, irresistible, may I conquer the gamblers with the dice.
2 From every side, from hale and sick, impotent to defend themselves, may all the fortune of the folk as winnings pass into my hands.
3 I pray to Agni, him who guards his treasure: here, won by homage, may he pile our winnings. As 'twere with racing cars I bring my presents: duly with reverence, let me laud the Maruts.
4 With thee to aid us may we win the treasure: do thou assist our side in every battle. Give us wide room and easy way, O Indra; break down, O Maghavan, the foemen's valour.
5 I have completely cleaned thee out, won from thee what thou keptest back. As a wolf tears and rends a sheep, so do I tear thy stake away.
6 Yea, by superior play one gains advantage: in time he piles his spoil as doth a gambler. He overwhelms with wealth's inherent powers the devotee who keeps not back his riches.
7 May we all, much-invoked! repel with cattle want that brings sin, hunger with store of barley. May we uninjured, first among the princes, obtain possessions by our own exertions.
8 My right hand holds my winnings fast, and in my left is victory. I would that I were winner of cattle and horses, wealth and gold.
9 Dice, give me play that bringeth fruit as it were a cow with flowing milk! And, as the bowstring binds, the bow, unite me with a stream of gains.
The above could not be much more straightforward. It is an incantation which repeatedly mentions getting rich via gambling, using dice.
Finally, another passage in Book 7 of the Atharvaveda, which invokes multiple deities for help in winning at gambling:
Atharvaveda - Book 7, Hymn 109
1 My homage to the strong, the brown, the sovereign lord among the dice! Butter on Kali I bestow: may he be kind to one like me.
2 Bear butter to the Apsarases, O Agni, and to the Dice bear dust and sand and water. The Gods delight in both oblations, joying in sacrificial gifts apportioned duly.
3 The Apsarases take pleasure in the banquet between the Sun and the libation-holder. With butter let them fill my hands, and give me, to be my prey, the man who plays against me.
4 Evil be mine opponent's luck! Sprinkle thou butter over us. Strike, as a tree with lightning flash, mine adversary in the game.
5 The God who found for us this wealth for gambling, to cast the dice and count the winning number, may he accept the sacrifice we offer, and with Gandharvas revel in the banquet.
6 Fellow-inhabitants, such is your title, for Dice with looks of power support dominion. As such with offerings may we serve you, Indus! May we have riches in our own possession.
7 As I invoke the Gods at need, as I have lived in chastity, may these, when I have grasped the Dice, the brown, be kind to one like me.
The above asks the deities to "give me, to be my prey, the man who plays against me", and exclaims, "Evil be my opponent's luck!" - "Strike, as a tree with lightning flash, my adversary in the game".
Therefore, Hinduism contradicts itself in that gambling, though prohibited in the Rigveda, and Manusmriti, is something promoted in the Atharvaveda.
The Samhita portions of the Vedas do not spell out a robust or codified morality, being mostly hymns, prayers, and incantations. However, when the Rigveda makes a rare foray into morality, and wisely advises against gambling, the Atharvaveda contradicts it, and compels prayers for good luck while gambling.