Hello there,
I am about to create an Lottery event for my community in a L2 Server and I've faced a problem while coding the points part.
I've used a label and a textbox(7), I wrote 100 inside the box(max points).
But I want to set it that everytime someone loses the lottery the points should be decreased by 20. (100->80->60->40->20->0) and so on.
I've coded the lottery part, numbers, etc. But I don't know how to write the following lines:
If Button1.Enabled Then
MessageBox.Show("You're going to spend -20 points for this turn, are you sure?", "Warning!", MessageBoxButtons.OKCancel)
End If
If TextBox1.Text = "80" Then
TextBox2.Text = "33"
TextBox3.Text = "42"
TextBox4.Text = "65"
TextBox5.Text = "99"
TextBox6.Text = "1"
MessageBox.Show("Congratulations!, You're the lucky winner! The GM has been informed about your winning and he will contact you as soon as possible!")
Else
MessageBox.Show("Unfortunately, you didn't win this time. 20 points were removed from your balance.")
**-> I want here to write that from 100 points which is written in textbox7(read only) to decrease by 20. (so this means it should change to 80 and so on)
End If
In general, I want it when someone loses the lottery the points should be decreased by 20.
P.S: I've set my own numbers in the boxes because I will code it so when someone finds at least 3 of my numbers to be emailed with his name so I can reward him in game.
P.S2: Here's a picture of the program w/o any graphics improvements at the moment(still coding):
![]()
I am about to create an Lottery event for my community in a L2 Server and I've faced a problem while coding the points part.
I've used a label and a textbox(7), I wrote 100 inside the box(max points).
But I want to set it that everytime someone loses the lottery the points should be decreased by 20. (100->80->60->40->20->0) and so on.
I've coded the lottery part, numbers, etc. But I don't know how to write the following lines:
If Button1.Enabled Then
MessageBox.Show("You're going to spend -20 points for this turn, are you sure?", "Warning!", MessageBoxButtons.OKCancel)
End If
If TextBox1.Text = "80" Then
TextBox2.Text = "33"
TextBox3.Text = "42"
TextBox4.Text = "65"
TextBox5.Text = "99"
TextBox6.Text = "1"
MessageBox.Show("Congratulations!, You're the lucky winner! The GM has been informed about your winning and he will contact you as soon as possible!")
Else
MessageBox.Show("Unfortunately, you didn't win this time. 20 points were removed from your balance.")
**-> I want here to write that from 100 points which is written in textbox7(read only) to decrease by 20. (so this means it should change to 80 and so on)
End If
In general, I want it when someone loses the lottery the points should be decreased by 20.
P.S: I've set my own numbers in the boxes because I will code it so when someone finds at least 3 of my numbers to be emailed with his name so I can reward him in game.
P.S2: Here's a picture of the program w/o any graphics improvements at the moment(still coding):
