I was testing a npc on N-Pulse when I noticed I dug up 2 items at once.. how could this be? I only generate the number once.. and they both have seperate ranges..
PHP Code:
function checkdig(chx, chy) {
temp.randomnumber = random(0,100);
//player.chat = random(0,3) SPC temp.randomnumber;
if ( int(temp.randomnumber) in |20,40| ) {
temp.obj = putnpc2(chx, chy, "");
temp.obj.image = "block.png";
temp.obj.join("shovel_obj");
}
if ( int(temp.randomnumber) in |50,60| ) {
temp.obj = putnpc2(chx, chy, "");
temp.obj.image = "np_worm.png";
temp.obj.join("shovel_obj");
}
}
This is serverside also.
And yes I will be using case/switch. But any reason this would be acting this way?