View Single Post
  #1  
Old 01-27-2012, 06:13 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Strange Random() ?

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(chxchy) {
  
temp.randomnumber random(0,100);
  
//player.chat = random(0,3) SPC temp.randomnumber;
  
if ( int(temp.randomnumberin |20,40| ) {
    
temp.obj putnpc2(chxchy"");
    
temp.obj.image "block.png";
    
temp.obj.join("shovel_obj");
  }
  if ( 
int(temp.randomnumberin |50,60| ) {
    
temp.obj putnpc2(chxchy"");
    
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?
Reply With Quote