(random array is chosen due to a percent chance that it has)
Code: Select all
$randomdrop = "1,2,3,4,5,6";
$randomdrop2 = "10,80,50,60,30,40";
$a = explode(",",$randomdrop);
$b = explode(",",$randomdrop2);
mt_srand((double)microtime()*1000000);
$k = array_keys($a);
$r = mt_rand(0, count($k)-1);
echo $a[$r]." %".$b[$r];
$percent=$b[$r]/10;
if (rand($percent,10) == 10)
{echo $a[$r]." good!";}
the sample code will pick a random array and then will randomly display a "good" if the percent is high enough. problem with this is i would like it to always pick a random array.
example would be
apple - common
sword - rare
the apple would have more of a chance to be chosen yet the sword can still appear.
idonno if i went on too much of an explaining rant but oh well, if anyone could help that would be awesome!!
Thanks, Sled