Hello, I'm creating a system of items on my site. Each item has a certain chance of winning.
For example, 0.01%
I would like to know how to do for PHP every time the user plays, try to earn some item with that percentage.
Type like this:
if(drop_item(0.01) == true) {
echo "Você ganhou uma poção!";
} else {
echo "Você não ganhou nada!";
}
If you knew how to do this with multiple items, with each item with a chance to win, I would be very happy :)
Thanks for your attention.